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
hi: Could you please provide the source code of exporting onnx file?
The text was updated successfully, but these errors were encountered:
import torch from lib.model_test import D2Net from lib.utils import preprocess_image from lib.pyramid import process_multiscale
use_cuda = torch.cuda.is_available() device = torch.device("cuda:0" if use_cuda else "cpu")
model_file = '/home/badal/d2-net/d2_tf.pth' # Specify the path to your model file use_relu = True # Specify whether to use ReLU
model = D2Net( model_file=model_file, use_relu=use_relu, use_cuda=use_cuda )
model.eval()
dummy_input = torch.randn(1, 3, 480, 640, device=device)
onnx_file_path = '/home/badal/d2-net/onnx/model_new.onnx'
torch.onnx.export(model, dummy_input, onnx_file_path, export_params=True, opset_version=11, input_names=['input'], output_names=['descriptor' , 'score' , 'keypoint' ])
print(f"Model has been converted to ONNX and saved to {onnx_file_path}")
Sorry, something went wrong.
https://drive.google.com/file/d/17B-VuCAcNt7Mm40y3rJxEth5Nl6tTF8R/view?usp=sharing
No branches or pull requests
hi:
Could you please provide the source code of exporting onnx file?
The text was updated successfully, but these errors were encountered: