Closed tensarflow closed 2 years ago
Thanks for the report! I've filed an internal ticket for this, and the team will look into it.
[Ticket#: AIRO-1654]
Hello, I am not able to reproduce your error but a suggestion. Change the line 136 of https://github.com/Unity-Technologies/Robotics-Object-Pose-Estimation/blob/main/ROS/src/ur3_moveit/src/ur3_moveit/setup_and_run_model.py into the following:
output_translation, output_orientation = model(torch.stack(image).reshape(-1, 3, 224, 224).to(device))
I hope it will solve the issue. The change you made is also fine as it will force the inference of the network to be done by the CPU and not the GPU if the computer you are running the program on has one, and the network is pretty light so the inference time will be roughly the same in both cases.
I had the same problem and got same error messages.
'RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
This means that Input type of image is torch.cuda.FloatTensor
, but model is torch.FloatTensor
.
Should we call model.to(device)
after calling model.load_state_dict()
?
Official document:
After model return torch.cuda.FloatTensor
, we also need to call cpu()
before calling detach()
.
output_translation, output_orientation = output_translation.cpu().detach().numpy(), output_orientation.cpu().detach().numpy()
Thank you @adakoda for your report. I will make the changes.
Thanks @JonathanLeban for the PR linked above!
This fix has been merged into the dev
branch and will later be merged into main
--please feel free to pull the branch locally to verify that it resolves your issue. I will close the ticket out for now, but go ahead and reopen it if the problem persists. Thanks all!
Describe the bug
The pose estimation is not executed correctly. I get an error regarding model weights and input not being on the same device. When I change this line to this
it works fine.
To Reproduce
Used the demo Unity project, therefore did not everything in the 4 readme's.
Console logs / stack traces
Expected behavior
A working pose estimation.
Environment (please complete the following information, where applicable):
Version 0.8.0-preview.3
- March 24, 2021