-
Notifications
You must be signed in to change notification settings - Fork 4.3k
请问 batchnorm var 为 0 的时候是怎么处理的? #302
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
Comments
mxnet 模型转换过来的? |
从 caffe 转过来的, mean 和 var 全 0, scale 是 1 . 检查的时候发现是转换的时候出错, 在 caffe2ncnn.cpp 441行: |
If you check line 100 in file batch_norm_layer.cpp at the original caffe repo: BatchNorm layer, this problem when binlayer.blobs(2).data().data()[0] = 0 should be handled as follows: float scale_factor = binlayer.blobs(2).data().data()[0] == 0 ? 0 : 1 / binlayer.blobs(2).data().data()[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我在 batchnorm 的参数为 0 的时候,得到的输出是 nan,是不是需要做特殊设置?
The text was updated successfully, but these errors were encountered: