Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alnex.net test error #81

Closed
dsp6414 opened this issue Dec 4, 2018 · 2 comments
Closed

Alnex.net test error #81

dsp6414 opened this issue Dec 4, 2018 · 2 comments

Comments

@dsp6414
Copy link

dsp6414 commented Dec 4, 2018

Describe the bug
RuntimeError: [ONNXRuntimeError] : 1 : GENERAL ERROR : No suitable kernel definition found for op Dropout(6)

System information

  • windows 10:
  • onnxruntime-0.1.4-cp36-cp36m-win_amd64.whl:
  • ONNX Runtime version:0.1.4
  • Python version:3.6

code:
from torch.autograd import Variable
import torch.onnx
import torchvision
import os
def get_runningfile_path():
return os.path.dirname(os.path.abspath(file))
root_path = get_runningfile_path()
dummy_input = Variable(torch.randn(1, 3, 224, 224))
model = torchvision.models.alexnet(pretrained=True)
torch.onnx.export(model, dummy_input,os.path.join(root_path,'alexnet.onnx'))

Compute the prediction with ONNX Runtime

import onnxruntime as rt
import numpy

img = numpy.random.rand(1,3,224,224)
sess = rt.InferenceSession(os.path.join(root_path,'alexnet.onnx'))
input_name = sess.get_inputs()[0].name
label_name = sess.get_outputs()[0].name
pred_onx = sess.run([label_name], {input_name: img.astype(numpy.float32)})[0]
print(pred_onx)

@jywu-msft
Copy link
Member

onnxruntime only supports opset 7 and later.
the error you are encountering is due to the model containing opset 6 ops, specifically Dropout-6

@snnn
Copy link
Member

snnn commented Dec 4, 2018

Close it because we have no plan to support opset 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants