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

Predicted output is black. #506

Open
akshay9396 opened this issue Aug 2, 2024 · 5 comments
Open

Predicted output is black. #506

akshay9396 opened this issue Aug 2, 2024 · 5 comments

Comments

@akshay9396
Copy link

I trained the model on Carvana dataset. Below is the screen shot of training. There i you can clearly see that validation Dice score is constant for 5 epochs and loss is "nan". I used one checkpoint.pth for predication and i got black output. could you please help me to resolved this issue.
image
Capture

@Feng2100
Copy link

Have you solved it? I'm having the exact same problem

@chenshans
Copy link

I'm having the exact same problem,too

2 similar comments
@berda-ak
Copy link

I'm having the exact same problem,too

@CZG0712
Copy link

CZG0712 commented Oct 21, 2024

I'm having the exact same problem,too

@taipain
Copy link

taipain commented Nov 14, 2024

I trained the model on Carvana dataset. Below is the screen shot of training. There i you can clearly see that validation Dice score is constant for 5 epochs and loss is "nan". I used one checkpoint.pth for predication and i got black output. could you please help me to resolved this issue. image Capture

Probably the reason is that torch.float16 is used in autocast() when using AMP.
So, change torch.float16 to torch.bfloat16.
But, if you wanna use torch.float16, you add grad_scaler in init_scale=4096.
I solved this issue.
I referred to the following sites.
This is my first time commenting on github, so sorry if there is something wrong and my poor English.
https://qiita.com/takeuchiseijin/items/909c48b57127a37fbd12
https://qiita.com/bowdbeg/items/71c62cf8ef891d164ecd

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

6 participants