-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
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
Error Tracing the model using torch.jit.trace
#34
Comments
fixed it model = AnyNet(args)
model = nn.DataParallel(model).cuda()
checkpoint = torch.load('/content/checkpoint/kitti2015_ck/checkpoint.tar')
model.load_state_dict(checkpoint['state_dict'], strict=False)
torch.save(model.module.state_dict(), 'non-parallel-model.pth')
model_np = AnyNet(args)
model_np = model_np.cuda()
model_np.load_state_dict(torch.load('non-parallel-model.pth'), strict=False)
model_np = model_np.eval()
example = [torch.rand(1, 3, 1280, 720).cuda(), torch.rand(1, 3, 1280, 720).cuda()]
traced_model = torch.jit.trace(model_np, example_inputs=example)
traced_model.save("anynet_1280x720_b1.traced.pt") the key was to save |
try: traced_model = torch.jit.trace(model, example_inputs=example) to traced_model = torch.jit.trace(model.module, example_inputs=example) |
When trying to use the following command:
I am getting "Could not export Python function call 'GateRecurrent2dnoindFunction' ". How do I resolve this?
|
While trying to export the model to traced pytorch model, i am getting
Could not export Python function call 'Scatter'
how do i resolve this ?Notebook for reference: https://colab.research.google.com/drive/1vf8osp0aeQA7dgBTw5Ejy9OibGOvgpaj?usp=sharing
The text was updated successfully, but these errors were encountered: