Skip to content
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

fixed gpu error #55

Closed
wants to merge 1 commit into from
Closed

fixed gpu error #55

wants to merge 1 commit into from

Conversation

adakoda
Copy link

@adakoda adakoda commented Jan 20, 2022

#52 modification still cause following error.
->
Error processing request: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

So we need to convert output type to cpu from gpu.

Note:
If you use docker environment, please add --gpus all option.

docker run -it --rm --gpus all -p 10000:10000 -p 5005:5005 unity-robotics:pose-estimation /bin/bash

You can also use nvidia-smi command in docker whether gpu is enable or not.

…e type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
@JonathanLeban
Copy link
Contributor

thank you @adakoda on your report and your suggestion. What is the line causing the error about the conversion to cuda:0 ?

@adakoda
Copy link
Author

adakoda commented Jan 20, 2022

@JonathanLeban

What is the line causing the error about the conversion to cuda:0 ?

output_translation, output_orientation = output_translation.detach().numpy(), output_orientation.detach().numpy()

The model return gpu device type and you will get following error message.

Error processing request: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

@at669
Copy link
Contributor

at669 commented Jan 20, 2022

Hi @adakoda, this repo is not currently accepting external contributions, as per the Contributing Guidelines. For that reason, I will close this PR, but please feel free to continue discussing in this thread, @JonathanLeban and @adakoda. Once resolved, the potential fix will be added via an internal PR. Sorry for the inconvenience!

@at669 at669 closed this Jan 20, 2022
@adakoda
Copy link
Author

adakoda commented Jan 21, 2022

@at669 @JonathanLeban
Thank you for your works!

This is the description of the sequence of code.
This notebook is available on Google CoLab for anyone to try.
https://github.com/adakoda/Robotics-Object-Pose-Estimation/blob/fixed_cpu_error/Model/Pose_Estimation_not_working_correctly_45.ipynb

I hope this explanation will be useful to someone.
I applicaiate your hard works.

@JonathanLeban
Copy link
Contributor

Hey ! So the problem was solved in the dev branch and we are going to merge the dev branch with the main branch soon. Thank you !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants