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

RuntimeError: Not implemented on the CPU (When running example notebook) #15

Closed
Robotatron opened this issue Dec 6, 2022 · 6 comments
Closed
Labels
error Encountering errors while running the code

Comments

@Robotatron
Copy link

Robotatron commented Dec 6, 2022

Using your example notebook getting an error RuntimeError: Not implemented on the CPU

image

Changing cfg.MODEL.DEVICE and cpu_device = torch.device("cpu") to "cuda" throws a different error

image

@praeclarumjj3
Copy link
Member

Hi @Robotatron, thanks for your interest in our work.

It is strange that you are encountering this error, as the notebook works perfectly fine when I execute the cells. It would be best if you do not replace cpu with cuda in cpu_device = torch.device("cpu") as we need to transfer the result to the CPU to convert it into a NumPy array. Are you sure you did not make any other changes to the notebook?

I would like you to confirm if you are cloning the OneFormer-Colab repo. If you still face issues, you may look at the Roboflow youtube video covering our demo.

Screenshot 2022-12-05 at 6 06 07 PM

@praeclarumjj3 praeclarumjj3 added the error Encountering errors while running the code label Dec 6, 2022
@praeclarumjj3
Copy link
Member

Closing this issue for now. Feel free to reopen if you face any issues.

@Robotatron
Copy link
Author

Are you sure you did not make any other changes to the notebook?

I am using the notebook locally, in a freshly created conda env following your guides.

@Robotatron
Copy link
Author

Robotatron commented Dec 7, 2022

  1. Your google colab notebooks works.
  2. However if I clone this repo locally and using your exact code (https://pastebin.com/bn0v0Ce5) I get the "RuntimeError: Not implemented on the CPU"
  3. Using CUDA 11.3 Pytorch install, however "nvidia-smi" shows me I have CUDA 11.2 installed. And under
    cat /usr/local/cuda/version.txt it says "11.0". Could this be a problem?
  4. Also the path for CUDA_HOME, should it be /usr/local/cuda/ or /usr/local/cuda/bin ? I tried both to no avail.
    image

@praeclarumjj3
Copy link
Member

Hi @Robotatron, yeah, that's precisely the issue. When you use Pytorch with cuda build 11.3, it expects CUDA >= 11.3. If you have a lower cuda version, try installing torch with cuda 11.0. That should solve the issue.

@Robotatron
Copy link
Author

@praeclarumjj3 Thank you very much, it was indeed an issue with PyTorch installed with CUDA 11.3. Using PyTorch with 11.1 on a machine with 11.2 solved the issue!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error Encountering errors while running the code
Projects
None yet
Development

No branches or pull requests

2 participants