GithubHelp home page GithubHelp logo

Comments (5)

APhun avatar APhun commented on August 15, 2024 1

I think I have solve the problem.
In load_data.py, line 53 should be changed into
'image = np.array(Image.open(os.path.join(image_path, image_name)).convert('L'))'
Because the default mode of 'Image.open()' to load images is 'RGB'.
Maybe it is the same solution to this issueπŸ˜€ (i didn't try yet)

from cyclegan-keras.

simontomaskarlsson avatar simontomaskarlsson commented on August 15, 2024

Hi @APhun,

Sounds like you did everything right and that this is an error in the code. This since you should be able to use grayscale images if you want to. If you have color images (e.g. rgb) you want to use the size 256x256x3 but as you suggest it can work for you also even if you have grayscale images. The downside is that training takes more time.

On which row in the code is the error thrown?
My guess is that there is a problem in the saveImages-function on row 665-711 and that the if-statements on row 684 and 695 if self.channels == 1: # Use the paired data for MR images should not be there. So you could try to modify the code by removing rows 684-688 and 695-699.

from cyclegan-keras.

APhun avatar APhun commented on August 15, 2024

Thanks a lot. The error didn't occur any more.
By the way, I noticed the comment β€œfor MR images”, I guess you are also studying medical images :)

from cyclegan-keras.

simontomaskarlsson avatar simontomaskarlsson commented on August 15, 2024

That is correct πŸ‘ Check out https://github.com/simontomaskarlsson/GAN-MRI and https://arxiv.org/abs/1806.07777 to see a part of the research. I've studied both medical MR images and street view rgb images using this implementation of CycleGAN.

Always fun to meet new people in the merged deep learning and medtech field!

from cyclegan-keras.

APhun avatar APhun commented on August 15, 2024

Oops😭 the same mistake occurs when I generate synthetic images (training have done and using load_model_and_generate_synthetic_images). I tried to find the solution but I failed.
Do you have any idea to solve it?

from cyclegan-keras.

Related Issues (20)

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.