We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug RuntimeError: [ONNXRuntimeError] : 1 : GENERAL ERROR : No suitable kernel definition found for op Dropout(6)
System information
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'))
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)
The text was updated successfully, but these errors were encountered:
onnxruntime only supports opset 7 and later. the error you are encountering is due to the model containing opset 6 ops, specifically Dropout-6
Sorry, something went wrong.
Close it because we have no plan to support opset 6.
No branches or pull requests
Describe the bug
RuntimeError: [ONNXRuntimeError] : 1 : GENERAL ERROR : No suitable kernel definition found for op Dropout(6)
System information
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)
The text was updated successfully, but these errors were encountered: