models icon indicating copy to clipboard operation
models copied to clipboard

Fail to run the onnx demo

Open wangxiang2713 opened this issue 4 years ago • 2 comments

I try to run the onnx demo: https://github.com/onnx/models/blob/master/vision/classification/imagenet_inference.ipynb with model squeezenet, but i got error:

ValueError: You created Module with Module(..., data_names=['data']) but input with name 'data' is not found in symbol.list_arguments(). Did you mean one of:
        data_0
        conv1_w_0
        conv1_b_0
        fire2/squeeze1x1_w_0
        ...

I find the input node name is data, what should i do?

wangxiang2713 avatar Apr 01 '20 12:04 wangxiang2713

I succeed run the code by changing code

mod = mx.mod.Module(symbol=sym, context=ctx, label_names=None)
mod.bind(for_training=False, data_shapes=[('data', (1,3,224,224))],label_shapes=mod._label_shapes)

to

mod = mx.mod.Module(symbol=sym, context=ctx, data_names=['data_0'], label_names=None)
mod.bind(for_training=False, data_shapes=[('data_0', (1,3,224,224))],label_shapes=mod._label_shapes)

However, i get result:

class=n15075141 toilet tissue, toilet paper, bathroom tissue ; probability=1.000000
class=n02319095 sea urchin ; probability=1.000000
class=n02395406 hog, pig, grunter, squealer, Sus scrofa ; probability=1.000000
class=n02391049 zebra ; probability=1.000000
class=n02389026 sorrel ; probability=1.000000

wangxiang2713 avatar Apr 01 '20 12:04 wangxiang2713

@wangxiang2713 got a similar issue, were you able to resolve this?

AK391 avatar Mar 10 '22 04:03 AK391