Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Reshape Layer Error, it's a BUG??


when I use mvNCCheck for my model, I got an error:


Traceback (most recent call last): File "/usr/local/bin/mvNCCompile", line 169, in <module> create_graph(, args.image, args.inputnode, args.outputnode, args.outfile, args.nshaves, args.inputsize, args.weights, args.explicit_concat, args.ma2480, args.scheduler, args.new_parser, args) File "/usr/local/bin/mvNCCompile", line 148, in create_graph load_ret = load_network(args, parser, myriad_config) File "/usr/local/bin/ncsdk/Controllers/", line 103, in load_network parse_ret = parse_caffe(arguments, myriad_conf) File "/usr/local/bin/ncsdk/Controllers/", line 773, in parse_caffe new_shape_X = layer.reshape_param.shape.dim[3] IndexError: list index (3) out of range


so I look at /usr/local/bin/ncsdk/Controllers/ , I found:


if isReshape(layer.type): if(len(layer.reshape_param.shape.dim) == 3): new_shape_X = 1 new_shape_Y = layer.reshape_param.shape.dim[2] new_shape_C = layer.reshape_param.shape.dim[1] else: new_shape_X = layer.reshape_param.shape.dim[3] new_shape_Y = layer.reshape_param.shape.dim[2] new_shape_C = layer.reshape_param.shape.dim[1]


it seem the reshape layer's shape must be 3D or 4D, but one layer in my model is 2D, I want use reshape layer to reshape the 2D tensor to 1D tensor.


it's a bug? Is possible to reshape 2D to 1D? any help will be appreciate!
0 Kudos
1 Reply

@shujunhua You can try using the flatten operation. See if this works for you.

0 Kudos