You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dummy_input=torch.zeros(input_shape, dtype=torch.float32)
torch.onnx.export(model, # model being run dummy_input, # model input (or a tuple for multiple inputs) "MultiVarCnn.onnx", # where to save the model export_params=True, # store the trained parameter weights inside the model file # dynamo=True,opset_version=20, # the ONNX version to export the model to # do_constant_folding=True, # whether to execute constant folding for optimization input_names= ['modelInput'], # the model's input names output_names= ['modelOutput'], # the model's output names # dynamic_axes={'modelInput' : {0 : 'batch_size'}, # variable length axes # 'modelOutput' : {0 : 'batch_size'}}
)
平台(如果交叉编译请再附上交叉编译目标平台):
linux
Github版本:
问题
模型:
转为onnx
转为MNN
推理
Pytorch
ONNX
MNN-interpreter
MNN-expr
MNN-array
速度对比
预热50次,推理1000次速度(总和):
看起来:onnx<torch<MNN-expr<MNN-interpreter<MNN-array
MNN貌似没有想象中的那么快,可能是什么原因呢?
The text was updated successfully, but these errors were encountered: