当前位置:   article > 正文

pytorch_v1.6 训练或检测时,报UserWarning: Mixed memory format inputs detected while calling the operator

userwarning: mixed memory format inputs detected while calling the operator.

在使用pytorch_v1.6训练或检测时,model报如下警告:

UserWarning: Mixed memory format inputs detected while calling the operator. The operator will output contiguous tensor even if some of the inputs are in channels_last format. (Triggered internally at  /pytorch/aten/src/ATen/native/TensorIterator.cpp:918.)

推测原因:由于pytorch  1.6版本的bug引起;因为同样的model,在1.7版本上,无此警告信息。

解决方法:在对应的警告代码后面加上“.contiguous()”即可。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/339413
推荐阅读
相关标签
  

闽ICP备14008679号