赞
踩
在使用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()”即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。