Comments (4)
If it is an error in the 0th output, that means your weights are still not fully updated so some values in your first predictions are nans. So it's not your inputs, but your model predictions that are nans. Could be an overflow or underflow error. This will make any loss function give you a tensor(nan)
.What you can do is put a check for when loss is nan and let the weights adjust themselves
criterion = SomeLossFunc()
eps = 1e-6
loss = criterion(preds,targets)
if loss.isnan(): loss=eps
else: loss = loss.item()
loss = loss+ L1_loss + ...
from ms-g3d.
If I don't use half precision then I had to reduce the batch size to 16 and forward to 8. And the "nan" occurs at 94th step "Function 'CudnnBatchNormBackward' returned nan values in its 0th output"
You suggested I might get poor performance or unstable loss. I am not really sure why half precision will do that.
from ms-g3d.
Hi @saniazahan,
Thanks for your interest. Please find below responses to the questions:
"Function 'LogSoftmaxBackward' returned nan values in its 0th output"
I've never seen this error before, could it be related to your package versions?
"... pretrained model trained on un-normalized data ..."
IIRC the data preprocessing steps should follow directly from 2s-AGCN: https://github.com/lshiwjx/2s-AGCN. Can you clarify what "normalized data" you are referring to? One particular thing to note is that following previous work there's also a BN layer at the beginning of the model to do normalization: https://github.com/kenziyuliu/MS-G3D/blob/master/model/msg3d.py#L156
"reduce the batch size to 16 and forward to 8. And the "nan" occurs at 94th step "Function 'CudnnBatchNormBackward' returned nan values in its 0th output"
Unfortunately I have not seen this error before. In general batch size is a hyperparameter that often affects performance, so to reproduce results from the paper you should use the default settings. Note also that small batch sizes don't go well with BatchNorm.
from ms-g3d.
Hi there, I'll be closing this issue for now. Feel free to comment below if the issue was not resolved.
from ms-g3d.
Related Issues (20)
- Is the format of data generated with `ntu_gendata.py` same as described in `lshiwjx/2s-AGCN`
- CUDA out of memory while evaluating pretrained HOT 4
- 数据类型为NoneTyoe格式 HOT 2
- Function 'CudnnBatchNormBackward' returned nan values in its 0th output HOT 3
- Recognizing activities using your library HOT 2
- Softmax scores HOT 5
- ST-private HOT 3
- 使用VS code运行直接终止并且没有报错
- Vs code运行代码直接终止,并且没有报错 HOT 7
- Can you provide Flops of this model? HOT 2
- running_mean should contain 54 elements not 108 HOT 2
- kinect 400 dataset HOT 1
- How to use it to predict an RGB video? HOT 1
- Change number of people in model HOT 2
- ValueError: invalid literal for int() with base 10: 'ntu' when run python ntu_gendata.py HOT 2
- About over-smoothing HOT 8
- Half Precision Training may cause discrepancies of test results between training and test time for the same model HOT 2
- How to make the frames not change? HOT 2
- Error in generating data HOT 1
- Shape error while predicting on custom video
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 ms-g3d.