Faster R-CNN, ValueError, total size of new array must be unchanged
2017-07-31 14:54
931 查看
问题:ValueError: total size of new array must be unchanged
在用Faster Rcnn训练数集的时候,出现报错
I0730 20:59:18.449447 20748 upgrade_proto.cpp:66] Attempting to upgrade input file specified using deprecated input fielTraceback (most recent call last): File "./tools/train_net.py", line 112, i <module> max_iters=args.max_iters) File "E:\1-XPJ\py-faster-rcnn\tools\..\lib\fast_rcnn\train.py", line 157, in train_net pretrained_model=pretrained_model) File "E:\1-XPJ\py-faster-rcnn\tools\..\lib\fast_rcnn\train.py", line 53, in __init__ self.solver.net.layers[0].set_roidb(roidb) File "E:\1-XPJ\py-faster-rcnn\tools\..\lib\roi_data_layer\layer.py", line 68, in set_roidb self._shuffle_roidb_inds() File "E:\1-XPJ\py-faster-rcnn\tools\..\lib\roi_data_layer\layer.py", line 35, in _shuffle_roidb_inds inds = np.reshape(inds, (-1, 2)) File "C:\Python27\lib\site-packages\numpy\core\fromnumeric.py", line 224, in reshape return reshape(newshape, order=order) ValueError: total size of new array must be unchanged ds: data/imagenet_models/ZF.v2.caffemodel
问题分析
这里是 reshape方法报错,reshape方法可以实现数组的变形,例如:
>>> from numpy import * >>> a = array([1,2,3,4]) >>> a.reshape(2, 2) <<< a = ([1,2],[3,4])
如果
>>> from numpy import * >>> a = array([1,2,3]) >>> a.reshape(2, 2)
则会报错
ValueError: total size of new array must be unchanged
解决方案
确保tarin.txt, trainval.txt里的文件数量为偶数相关文章推荐
- ValueError: total size of new array must be unchanged
- python reshape()函数ValueError: total size of new array must be unchanged
- FRM-30187: Size of CHAR column in record group must be between 1 and 2000
- FRM-30187: Size of CHAR column in record group must be between 1 and 2000
- ORA-12712: new character set must be a superset of old character set
- Python TypeError: return arrays must be of ArrayType
- FRM-30187: Size of CHAR column in record group must be between 1 and 2000.
- System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list
- 引入math模块中的log()方法,导致"TypeError: return arrays must be of ArrayType",什么原因?
- ffmpeg错误 Frame size must be a multiple of 2
- FRM-30187: Size of CHAR column in record group must be between 1 and 2000
- DIMMs must be installed in pairs of matched memory size, speed, and technolo
- thinkphp5错误:类型错误: Argument 1 passed to think\Hook::import() must be of the type array
- FRM-30187: Size of CHAR column in record group must be between 1 and 2000 解决方法
- Maven编译错误:Could not generate DH keypair: Prime size must be multiple of 64...
- 数据库字符集修改时报错ORA-12712: new character set must be a superset of old character set
- .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题
- Error: FRM-30187: Size of CHAR column in record group must be between 1 and 2000
- The type of the expression must be an array type but it resolved to Point
- mm_The type of the expression must be an array type but it resolved to List