caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

tutorials Loading Pre-Trained Models: RuntimeError: [enforce fail at tensor.h:675]

Open danfouer opened this issue 8 years ago • 2 comments

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) in () 9 10 # run the net and return prediction ---> 11 results = p.run([img]) 12 13 # turn it into something we can play with and examine which is in a multi-dimensional array

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

danfouer avatar Jan 29 '18 11:01 danfouer

Seems to duplicate https://github.com/caffe2/caffe2/issues/1559

nafest avatar Jan 29 '18 14:01 nafest

yes It is Duplicate of #1559,but no solution till now

danfouer avatar Jan 29 '18 21:01 danfouer