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
Hi, I have been meaning to convert the final o/p of docformer in the document classification notebook from .ckpt to onnx but am unable to do so. I have tried the standard torch.onnx.export method but the issue lies in the "dummy_variable" input in the code. Can you please point me in the right direction.
model = DocFormer.load_from_checkpoint(CKPT_PATH)
model.eval()
# Let's create a dummy input tensor
# Export the model
torch.onnx.export(model, # model being run
#for_conversion,
maintup,
#(input_ids,resized_scaled_img, x_features, y_features), # model input (or a tuple for multiple inputs)
"ImageClassifier.onnx", # where to save the model
export_params=True, # store the trained parameter weights inside the model file
opset_version=10, # the ONNX version to export the model to
do_constant_folding=True, # whether to execute constant folding for optimization
input_names = ['resized_scaled_img', 'x_features', 'y_features', 'input_ids', 'resized_and_aligned_bounding_boxes', 'label'], # the model's input names
# the model's output names
)
print(" ")
print('Model has been converted to ONNX')
The text was updated successfully, but these errors were encountered:
Hi, I have been meaning to convert the final o/p of docformer in the document classification notebook from .ckpt to onnx but am unable to do so. I have tried the standard torch.onnx.export method but the issue lies in the "dummy_variable" input in the code. Can you please point me in the right direction.
The text was updated successfully, but these errors were encountered: