Giter VIP home page Giter VIP logo

Comments (3)

Terminal-K avatar Terminal-K commented on July 29, 2024 1

@maenstru56
Hi, I think I have identified where the problem lies. When reading the mask image, I set 'as_grey' to True in the imread function as #4 , which causes the mask values to be in the range of (0,1), leading to an error (no raise) in the judgment of 'mask_'. I suggest modifying

for i in range(img_height):
for j in range(img_width):
if mask_[i, j] >= 127:
mask[i, j] = 1

as follows:
mask[mask_[:, :, 0] > 127] = 1
and it can harness the features of NumPy for acceleration as well.

I successfully made the code work using this approach with the environment of tf2.3.0.
image

from duck-net.

maenstru56 avatar maenstru56 commented on July 29, 2024

Hello,

This is not normal behaviour, the loss function should be decreasing during training. To fix the issue, please try the following;

  • Try to install Tensorflow 2.10.0, even if the code runs with version 2.3.0 there might be some important differences in how the backend functions are implemented that are causing this issue
  • Check the input and output images and their format, and make sure the network receives valid input
  • Check if the network actually learns during training. Maybe you can visualize some of the input and predicted images after every epoch to see how they compare with the ground truth.

I hope this helps!

from duck-net.

maenstru56 avatar maenstru56 commented on July 29, 2024

Hello,

In our original data loader the "imread" function is called without the "as_grey=True" parameter, so the original code should work as intended.

Thanks for pointing out the issue and finding a fix when the "as_grey" parameter is set to "True"!

from duck-net.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.