yolov3-network-slimming
yolov3-network-slimming copied to clipboard
division by zero(稀疏化训练时)
在稀疏化训练的时候发生了一下错误
zweistein@zweistein-System-Product-Name:~/桌面/yolov3-network-slimming$ python sparsity_train.py -sr --s 0.1 --image_folder cfg/coco.data --cfg cfg/yolov3.cfg --weights yolov3.weights
load network
done!
load weightsfile
done!
/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py:110: UserWarning: Anti-aliasing will be enabled by default in skimage 0.15 to avoid aliasing artifacts when down-sampling images.
warn("Anti-aliasing will be enabled by default in skimage 0.15 to "
/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py:110: UserWarning: Anti-aliasing will be enabled by default in skimage 0.15 to avoid aliasing artifacts when down-sampling images.
warn("Anti-aliasing will be enabled by default in skimage 0.15 to "
/usr/local/lib/python3.5/dist-packages/torch/nn/modules/upsampling.py:122: UserWarning: nn.Upsampling is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.Upsampling is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
File "sparsity_train.py", line 154, in
您好,我遇到了跟您相同的问题,请问您的问题解决了吗
@zhengshoujian 我已经解决了这个问题 将yolomodel.py第107行 precision = float(nCorrect / nProposals) 修改为 if nProposals: precision = float(nCorrect / nProposals) elif nCorrect: precision = 0 else: precision = 1
@nepulhl 谢谢!
在nProposals后加一个很小的值也是可以的,是为了避免出现nProposals做除数有等于0的情况的发生