Comments (4)
확실히
if not self.opt.no_vgg_loss:
#G_losses['VGG'] = self.criterionVGG(fake_RGB, target_RGB) * self.opt.lambda_vgg
pass
로 comment out 하니까 nan이 안나옴. VGG loss가 확실한 원인인데 이유를 모르겠음
짐작하기를 LAB2RGB 연산에서 뭔가 미분하면서 터지는 부분이 있는게 아닌가 싶음
from spade_colorization.
https://discuss.pytorch.org/t/function-powbackward0-returned-nan-values-in-its-0th-output/60882
이거를 참고하여 해결
from spade_colorization.
아 이거 known error 구나, loss 들도 전부 0 아니면 Nan 으로 뜸:
(epoch: 1, iters: 8, time: 1.210) GAN: -0.005 GAN_Feat: 3.050 VGG: 0.476 reconstruction: 0.005 contextual: 4.767 D_Fake: 0.000 D_real: 0.995
(epoch: 1, iters: 16, time: 5.390) GAN: nan GAN_Feat: nan VGG: nan contextual: nan D_Fake: 0.000 D_real: 0.000
/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/skimage/color/colorconv.py:979: RuntimeWarning: invalid value encountered in less
if np.any(z < 0):
/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/skimage/color/colorconv.py:987: RuntimeWarning: invalid value encountered in greater
mask = out > 0.2068966
/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/skimage/color/colorconv.py:630: RuntimeWarning: invalid value encountered in greater
mask = arr > 0.0031308
(epoch: 1, iters: 24, time: 5.014) GAN: nan GAN_Feat: nan VGG: nan reconstruction: nan contextual: nan D_Fake: 0.000 D_real: 0.000
(epoch: 1, iters: 32, time: 4.808) GAN: nan GAN_Feat: nan VGG: nan contextual: nan D_Fake: 0.000 D_real: 0.000
(epoch: 1, iters: 40, time: 5.101) GAN: nan GAN_Feat: nan VGG: nan reconstruction: nan contextual: nan D_Fake: 0.000 D_real: 0.000
(epoch: 1, iters: 48, time: 5.055) GAN: nan GAN_Feat: nan VGG: nan contextual: nan D_Fake: 0.000 D_real: 0.000
is_reconstructing
키든 안키든 터짐.- batchSize 상관 없이 2번째 Iteration 부터 터짐
from spade_colorization.
with autograd.detect_anomaly():
g_loss.backward()
이렇게 옵션을 지정해주면 backward시 gradient가 nan으로 터지는 부분을 잡아줄 수 있다. (검색해도 바로 안나와서 좀 놀랐다... 몇번 타고 들어가야 나옴)
File "/home/minds/.virtualenvs/spade/lib/python3.6/site-packages/torch/autograd/__init__.py", line 93, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: Function 'PowBackward0' returned nan values in its 0th output.
다음과 같이 터지는 걸로 보아 power 쪽에 문제가 있고 이에 따라 power 연산 부분을 수정예정
from spade_colorization.
Related Issues (20)
- Batch 1 이상이면 터짐 HOT 4
- Warped image useless HOT 3
- batch size 키워도 gpu util 이 너무 낮음
- confmap gradient 유무 확인 HOT 2
- Loss lambda 찾기 HOT 2
- decoder_only와 tgt_value_direct 에서도 conf_map update 가 되는 이유 HOT 1
- Discriminator 고도화 HOT 7
- 각 Loss 별로 껐다 키면서 loss에 따라 update가 잘 되고 있는지 check
- D에 들어가는 input을 lab에서 rgb로만 바꿨는데도 VGG loss가 이상하다....?? HOT 1
- Graidnet update 가 14 파라미터만 되는 것 같음 HOT 1
- loss lambda 계산이 잘못됨 HOT 6
- VGG Input 및 Condition 수정 필요 HOT 2
- correspondence subnet 을 독립적으로 트레이닝 HOT 3
- non local block 에 하나의 VGG 만 사용 HOT 1
- error during calculating fid score HOT 1
- model save/load 하는 부분이 이상해 보임
- Attention checkerboard pattern
- Decoder에게 refine을 맡기는것이 불가능하다 HOT 7
- AffinNet 내부의 격자무늬 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spade_colorization.