EfficientNet-PyTorch
EfficientNet-PyTorch copied to clipboard
Cannot resolve operator 'Shape' with opsets: ai.onnx v9
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.
Hi @amirdy did you ever find the solution?