Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset training #27

Closed
loaysh2010 opened this issue Jun 16, 2019 · 7 comments
Closed

Dataset training #27

loaysh2010 opened this issue Jun 16, 2019 · 7 comments

Comments

@loaysh2010
Copy link

loaysh2010 commented Jun 16, 2019

Hello, @LeeJunHyun
I followed your instruction by changing the path to my data in dataset.py L99,100 .. but after running main.py i got errors in L152(solver.py) about the unequal size of SR_Flat, GT_Flat !!

ValueError: Target and input must have the same number of elements. target nelement (196608) != input nelement (65536)

@loaysh2010 loaysh2010 changed the title Custom Dataset training Dataset training Jun 17, 2019
@LeeJunHyun
Copy link
Owner

Hello, @loaysh2010 .
You should use same size of ground truth.
Please check SR_Flat and GT_Flat size.

@loaysh2010
Copy link
Author

@LeeJunHyun ,
Thank you very much for your concern. Actually, I did check SR_Flat and GT_Flat size. the input image and GT image are the same size [1,3,256,256], but the SR image is [1,1,256,256], so I convert the GT image to grayscale [1,1,256,256] after flatting it be the same this. I hope that will overcome the problem.
Do you have any other idea?

@LeeJunHyun
Copy link
Owner

@loaysh2010 ,
I think your GT has 3 classes.
If I am correct, then you should change the number of output channel of network.

@loaysh2010
Copy link
Author

loaysh2010 commented Jun 20, 2019

@LeeJunHyun
my GT was saved as png colored image. so it has the shape of [1,3,256,256] where 3 is for RGB colors. So after converting it to grayscale it's shaped become [1,1,256,256] so when flatting it get the same size as SR flatted image.
do you think to change the number of output channel of the network better than convert the GT to grayscale with the previously mentioned shape ??

@LeeJunHyun
Copy link
Owner

If your GT has RGB channel, each channel must have its own meaning, right?
If so, it would be batter that you just keep GT as colored image.

@loaysh2010
Copy link
Author

@LeeJunHyun Changed the output channel for the model to 3. and error fixed
Thanks for your time. You can close the issue

@soans1994
Copy link

hello author,

how can i use your code for mutliclass segmentation. i have rgb ground truth.
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants