EfficientAT
EfficientAT copied to clipboard
onnx
how to convert this model to onnx type?
def export_onnx_model(model, input_shape, onnx_path, input_names=None, output_names=None, dynamic_axes=None):
inputs = torch.ones(*input_shape)
model(inputs)
torch.onnx.export(model, inputs, onnx_path, input_names=input_names, output_names=output_names,
dynamic_axes=dynamic_axes)
def export_onnx(model):
batch_size = 1
width = 128
height = 420
input_shape = (batch_size, 1, width, height)
onnx_path = "eat_dynamic_axis.onnx"
input_names = ['feats']
output_names = ['probe']
dynamic_axes = {'input': {0: 'batch_size', 2: 'width', 3: 'height'},
'output': {0: 'batch_size', 2: 'width'}} # adding names for better debugging
export_onnx_model(model, input_shape, onnx_path, input_names, output_names, dynamic_axes)
@zdj97 here is my onnx export code, but onnx has the same problem like ptmobile issue (https://github.com/fschmid56/EfficientAT/issues/26)
Yes. And what is the problem of ptmobile?
@zdj97 I updated my post, and do you mind add my email(thelou1s # yahoo.com). as we may doing the same task
Yes. I will test this onnx model. If I find any question, I will email to you.
@zdj97 Hi, do you got the onnx model file? do you make the dynamic_axes work?
I have converted ptmodel to onnxmodel. But I do not test preformance. When I test onnx preformance, I will contect you.
@zdj97 Hi, do you got the onnx model file? do you make the dynamic_axes work?
I have converted the mn pytorch model to onnx and do not find any question.
@zdj97 , Could you email me the converted onnx model file, so that I can compare it with mine. As In my use case, it performs badly. thanks
@zdj97 , Could you email me the converted onnx model file, so that I can compare it with mine. As In my use case, it performs badly. thanks
Hi, please tell me your email so that i send to you.
@zdj97 thelou1s [At] yahoo.com
@zdj97 Hi, do you got the onnx model file? do you make the dynamic_axes work?
I have converted the mn pytorch model to onnx and do not find any question.
can you convert the dymn pytorch model to onnx?
@thelou1s @zdj97 did you have success in the end? would you kindly share your complete export code? :)