Giter VIP home page Giter VIP logo

Comments (10)

khdlr avatar khdlr commented on July 20, 2024

This sounds like you are inputting images with 4 channels while having the model configured to take 3 channels as inputs.

As you were mentioning png inputs earlier, I'm assuming that you're reading the data as RGBA instead of RGB.

If you do not need the fourth channel, you can strip it away (img = img[:3]). If you do indeed need the fourth channel, you can set input_channels: 4 in the config.yml file.

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

Can you make sure that the loaded image array has only 3 channels? I.e. by adding print(img.shape) to the full_forward method in train.py?

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

Assuming you're using the provided INRIA data loading code, that will tile each input image into tiles of 256x256 (see the TILESIZE = 256 constant in deep_learning/utils/data.py.

I still believe that the fourth channel comes from the alpha channel in the png, could you simply cut it off by changing data = raster.read() to data = raster.read()[:3] in deep_learning/utils/data.py (and then also removing the cached .npz files?)

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

khdlr avatar khdlr commented on July 20, 2024

Yes but png files can have 4 channels, and when you convert them to tiff that 4th channel is probably kept. Could you please simply try the solution I suggested? Or what do you expect me to do here?

from hed-unet.

lisongyu111 avatar lisongyu111 commented on July 20, 2024

from hed-unet.

Related Issues (18)

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.