tutorials Loading Pre-Trained Models: RuntimeError: [enforce fail at tensor.h:675]
all the code above in Loading Pre-Trained Models is OK until:
initialize the neural net
with open(INIT_NET) as f: init_net = f.read() with open(PREDICT_NET) as f: predict_net = f.read()
p = workspace.Predictor(init_net, predict_net)
run the net and return prediction
results = p.run([img])
turn it into something we can play with and examine which is in a multi-dimensional array
results = np.asarray(results) print "results shape: ", results.shape
The error message is:
RuntimeError Traceback (most recent call last)
RuntimeError: [enforce fail at tensor.h:675] i < dims_.size(). 0 vs 0. Exceeding ndim limit Error from operator: input: "data" input: "conv1_w" input: "conv1_b" output: "conv1" type: "Conv" arg { name: "stride" i: 2 } arg { name: "pad" i: 0 } arg { name: "kernel" i: 3 } device_option { } engine: "" ** while accessing input: data
Seems to duplicate https://github.com/caffe2/caffe2/issues/1559
yes It is Duplicate of #1559,but no solution till now