im trying to convert .t7 to .onnx model, but i got something wrong. Currently using: torch.onnx.export()
path = "/home/t72onnx/best_model.t7"
model = PAConv(args).to(device)
dummy_input = torch.randn(16, 3, 1024).to(device)
model.load_state_dict({k.replace('module.', ''):v for k, v in torch.load(path, map_location=device).items()})
model.eval()
torch.onnx.export(model.to(device), # model being run
dummy_input.to(device), # model input (or a tuple for multiple inputs)
"my_mobileface.onnx", # where to save the model (can be a file or file-like object)
export_params=True, # store the trained parameter weights inside the model file
opset_version=12,
verbose=False,
do_constant_folding=True, # whether to execute constant folding for optimization
input_names = ['input'], # the model's input names
output_names = ['output'], # the model's output names
# Operator_export_types = torch.onnx.OperatorExportTypes.onnx_aten_fallack,
)
but i got RuntimeError with AssignScoreWithK
Traceback (most recent call last):
File "main.py", line 307, in <module>
torch.onnx.export(model.to(device), # model being run
File "/opt/conda/lib/python3.8/site-packages/torch/onnx/__init__.py", line 271, in export
return utils.export(model, args, f, export_params, verbose, training,
File "/opt/conda/lib/python3.8/site-packages/torch/onnx/utils.py", line 88, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "/opt/conda/lib/python3.8/site-packages/torch/onnx/utils.py", line 709, in _export
proto, export_map = graph._export_onnx(
RuntimeError: ONNX export failed: Couldn't export Python operator AssignScoreWithK
is that because torch.onnx.export does not surport PAConv model?
Many thanks!
Hi, nice work.
im trying to convert .t7 to .onnx model, but i got something wrong. Currently using: torch.onnx.export()
but i got RuntimeError with AssignScoreWithK
is that because torch.onnx.export does not surport PAConv model? Many thanks!