EfficientNet-PyTorch icon indicating copy to clipboard operation
EfficientNet-PyTorch copied to clipboard

Cannot resolve operator 'Shape' with opsets: ai.onnx v9

Open amirdy opened this issue 5 years ago • 1 comments

I got this Error when I run the exported onnx model on the browser.

opset.ts:48 Uncaught (in promise) TypeError: cannot resolve operator 'Shape' with opsets: ai.onnx v9

onnx :

model = EfficientNet.from_pretrained('efficientnet-b1')
model.eval()
model.set_swish(memory_efficient=False)
dummy_input = torch.randn(10, 3, 240, 240)
torch.onnx.export(model, dummy_input, "test-b1.onnx", verbose=True)

The browser side:

async function run(){
                const sess = new onnx.InferenceSession();
                await sess.loadModel("./static/test-b1.onnx");
		const input = new onnx.Tensor(new Float32Array(10*3*240	*240), 'float32',[10,3,240,240]);
		const outputMap = await sess.run([input]);
		const outputTensor = outputMap.values().next().value;
	}
run();

Thanks for your help.

amirdy avatar Aug 14 '20 15:08 amirdy

Hi @amirdy did you ever find the solution?

rapha18th avatar Mar 02 '21 12:03 rapha18th