GithubHelp home page GithubHelp logo

Comments (24)

taizan avatar taizan commented on June 12, 2024

It seems mistake or bug in opencv channel when read and write BGR or RGB.
we patched server executing part to check opencv version , but if training code used wrong channel, it can be occur...

from paintschainer.

mike199212 avatar mike199212 commented on June 12, 2024

Thank you for your response and information.
I will proceed with paying attention to it.

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

I encountered the same problem...
does it mean that I cannot use RBG image format to train?

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

@mike199212 Hello, may I ask if you successfully trained your model and avoided the green picture?

from paintschainer.

abbychau avatar abbychau commented on June 12, 2024

@czxrrr
Green pictures are probably caused by the mismatch of RGB channel.

find this line and try which one you should adapt to

8bf41ed#diff-a0143a1f10c063528854540f5f51196e

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

@abbychau I tried RGB and BGR... But it always output a green picture no matter what picture I feed to it.
I am curious about your original dataset
Were you using 4-channel png, or 3-channel jpg or something else?
Thanks for your patient help!

from paintschainer.

taizan avatar taizan commented on June 12, 2024

Is your local version of paint is work well?
If the problem was output of re-trained model only, it canbe failure of learning with GAN.
Please make sure your training work well without GAN first.

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

@taizan Do you mean using the StandardUpdate() ?

from paintschainer.

taizan avatar taizan commented on June 12, 2024

no, comment out
loss = loss_rec + loss_adv + loss_l
and use only
loss = loss_rec
you will get sepia images if it works well.

there are 2 suspicious problem

  • Input file types are wrapped by OpenCV but its standard channel is depends on environment.
  • training with adversarial network learning will sometimes collapse and output will crush.

I couldn't judge which problem is yours, now.

also I strongly recommend to train step by step, so check the result of model_of_128 1st.

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

I think the reason should be the first one, about the channels
I found that the first train will make all the pixels become 0 except for the Green channel, which means only green channel has non-zero value...
and no matter BGR or RGB I use , it turns green all the time.
(I am using Python3 with open cv 3.2.0)

from paintschainer.

taizan avatar taizan commented on June 12, 2024

Hi I got same problem in new environment setup.
The problem is miss much of cudnn version and GPU.
Pascal or some new GPU dose not support old cudnn and it couse all green output.

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

My cuda version is 7.5
Does that mean cuda 8.0 or higher should be installed?

from paintschainer.

taizan avatar taizan commented on June 12, 2024

It could be a reason of trouble and it is depends on your GPU.

from paintschainer.

czxrrr avatar czxrrr commented on June 12, 2024

@taizan
Thank you.
And Currently I am training my model, I found that after training.
The output of a line graph is like this (YUV)
[ 3.9902513 4.66042328 5.40228987]
[ 3.48818111 3.29726362 4.91220808]
[ 2.51852775 2.57776284 3.40684319]]]
So, the YUV will be converted into RGB like this
[ 0 123 0]
[ 0 124 0]
[ 0 124 0]]]
and all the pixels of YUV are near to 0, and the Green channel of RGB will be near to 128 and all others will be 0.
That's the reason why green images haunt all the time

Do you have any suggestion about why the output YUV is very near to 0.
Does that mean the number of my training images is not enough?
I only fed 1000 images to the model

from paintschainer.

taizan avatar taizan commented on June 12, 2024

please make sure you are using suitable version of cudnn.
and make sure opencv input & output is correctly done.

from paintschainer.

mike199212 avatar mike199212 commented on June 12, 2024

I apologize for late reply.
After I re-installed OpenCV by the same way described in Installation guide, that is, conda install -c menpo opencv3, then the problem was solved in my environments.

from paintschainer.

taizan avatar taizan commented on June 12, 2024

OK thats good

from paintschainer.

shengyu-meng avatar shengyu-meng commented on June 12, 2024

@czxrrr
Hi, do you solve your problem? I meet the same problem with you.
I currently use windows 10 64bit, python 3.5, OpenCV 3.2, GTX 1070, CUDA 8.0, cudnn 5.1 (should be high version enough to fit the pascal GPU).
The local server works well with the pre-trained model, but all the output always will be green when i use my own-trained model, even though after i remove the GAN in train_128.
The opencv and cuda seems works well when i test them by other commands.
I am not a programmer but i hope my description is clear enough. It you have any progress of solving this please let me know. thanks!

from paintschainer.

gjghks avatar gjghks commented on June 12, 2024

@taizan @czxrrr @liyourk
Hi, thanks for your great works and discussions.
I meet the same problem which has green results using my own training dataset.
and I try change cudnn version 2.0~6.0 and I re-install cupy & chainer during every change cudnn ver.
I use GTX 970 or 1080, and try linux & windows both. but all results have green.
How can I fix it?
Actually, your demo website is updated, so I think you already fix this problem on some new graphic card or cudnn ver or I do not know things.
If you have some solutions, please teach me. thank you.

from paintschainer.

taizan avatar taizan commented on June 12, 2024

dose our pretrained model work in your environment ?
If so, the input data format readed by opencv can be one of problem.
or there are maybe some problem in your training process.

from paintschainer.

lllyasviel avatar lllyasviel commented on June 12, 2024

You can use some standard deep learning tools as your beginning:
pix2pix: https://github.com/phillipi/pix2pix
cycleGAN: https://github.com/junyanz/CycleGAN
Chainer version:
pix2pix: https://github.com/pfnet-research/chainer-pix2pix
cycleGAN: https://github.com/Aixile/chainer-cyclegan

from paintschainer.

gjghks avatar gjghks commented on June 12, 2024

@taizan
Thank you taizan! for reply!
your pre-trained model works fine!
below image is my green result using own dataset.
bxl7gn8n3m1eay3jjjcn631l75gf57wx_0

as you said, is this not a problem about GPU or cudnn version?
below images are original and line images (128x128) for training.
I try jpg and png file both, but results are same green results.
1 1

and below image is RGB to YUV image.
yuv

I use opencv 3.3.0.
What do you think about my situation?
Please I hope to help.

from paintschainer.

gjghks avatar gjghks commented on June 12, 2024

@lllyasviel
Thank you for reply!
Fix the problem first and I will check the sites you said.
I interested in deep learning especially GAN.
Thanks for your kindness.

from paintschainer.

Jade-Shi avatar Jade-Shi commented on June 12, 2024

i met the same problems recently and i try many ways to fix the green output problem.
i use opencv3.2.0 , and the BGR2YUV may loss some picture information. so i use BGR2YCrCb ,but the output is the same.
i want to know how to fix the problem?

from paintschainer.

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.