RuntimeError: invalid argument 4: out of range at pytorch/torch/lib/TH/generic/THTensor.c:439
2017-12-02 10:06
766 查看
使用from torchvision.utils import save_image保存图像时,出现错误:
File “/usr/local/lib/python2.7/dist-packages/torchvision/utils.py”, line 51, in save_image
File “/usr/local/lib/python2.7/dist-packages/torchvision/utils.py”, line 38, in make_grid
.narrow(2, x*width+1+padding//2, width-padding)\
RuntimeError: invalid argument 4: out of range at /pytorch/torch/lib/TH/generic/THTensor.c:439
原因是torchvision版本不对,解决方法是卸载torchvision,并重新安装,
File “/usr/local/lib/python2.7/dist-packages/torchvision/utils.py”, line 51, in save_image
grid = make_grid(tensor, nrow=nrow, padding=padding)
File “/usr/local/lib/python2.7/dist-packages/torchvision/utils.py”, line 38, in make_grid
.narrow(2, x*width+1+padding//2, width-padding)\
RuntimeError: invalid argument 4: out of range at /pytorch/torch/lib/TH/generic/THTensor.c:439
原因是torchvision版本不对,解决方法是卸载torchvision,并重新安装,
pip uninstall torchvision pip install torchvision
相关文章推荐
- RuntimeError: invalid argument 1: must be strictly positive at /pytorch/torch/lib/TH/generic/THTenso
- SQLite: Cannot bind argument at index 1 because the index is out of range. The statement has 0 param
- System.ArgumentOutOfRangeException at System.Web.HttpCachePolicy.UtcSetLastModified (DateTime utcDate)
- java.lang.IllegalArgumentException: pointerIndex out of range
- Tensorflow tf.nn.in_top_k Error targets[0] is out of range
- Sys.ArgumentOutOfRangeException: Value must be an integer
- java.lang.IllegalArgumentException: pointerIndex out of range 问题的两种解决办法
- Sys.ArgumentOutOfRangeException: Value must be an integer
- 图片缩放时java.lang.IllegalArgumentException: pointerIndex out of range解决方案
- FAQ(52):java.sql.SQLException: Column Index out of range, 0 > 13. at com.mysql.jdbc.ResultSet.getInt
- Sys.ArgumentOutOfRangeException: Value must be an integer 错误的原因
- Specified argument was out of the range of valid values. 解决方法
- 大图页面图片缩放java.lang.IllegalArgumentException: pointerIndex out of range死掉解决方案
- Android 中 java.lang.IllegalArgumentException: pointerIndex out of range 异常的处理方法
- Android java.lang.IllegalArgumentException: pointerIndex out of range
- Sys.ArgumentOutOfRangeException: Value must be an integer
- 消息: Sys.ArgumentOutOfRangeException: Value must be an integer
- 完美解决java.lang.IllegalArgumentException: pointerIndex out of range
- django mktime argument out of range
- Sys.ArgumentOutOfRangeException: Value must be an integer.