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 #1

Open
foureyelabs opened this issue May 8, 2021 · 6 comments
Open

RuntimeError #1

foureyelabs opened this issue May 8, 2021 · 6 comments

Comments

@foureyelabs
Copy link

Hello Zhang,

First of all, thank you for your code!

However, when I try to run it, I get the following error:

RuntimeError: Expected one of cpu, cuda, xpu, mkldnn, opengl, opencl, ideep, hip, msnpu, xla, vulkan device type at start of device string: h

I'm not sure if you encountered this before or have a solution for it.

Thank you for your time!

Ethan

@DunZhang
Copy link
Owner

DunZhang commented May 8, 2021

Hello Zhang,

First of all, thank you for your code!

However, when I try to run it, I get the following error:

RuntimeError: Expected one of cpu, cuda, xpu, mkldnn, opengl, opencl, ideep, hip, msnpu, xla, vulkan device type at start of device string: h

I'm not sure if you encountered this before or have a solution for it.

Thank you for your time!

Ethan

Hello, can you provide your codes?

@foureyelabs
Copy link
Author

foureyelabs commented May 8, 2021 via email

@foureyelabs
Copy link
Author

foureyelabs commented May 8, 2021 via email

@DunZhang
Copy link
Owner

@foureyelabs
Sorry to reply you so late.
I tried the simple example in https://github.com/DunZhang/KnowledgeDistillation and didn't encounter this question.
According to the error information, the torch may not find the correct device. You could try the following codes:

import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

Please put the codes in the top.

@foureyelabs
Copy link
Author

foureyelabs commented May 13, 2021 via email

@DunZhang
Copy link
Owner

@foureyelabs
Very very very sorry to reply you so late. I am really busy.
Try my new code : https://drive.google.com/file/d/1ApApQpY90d9TV-fRtvroWE-FHpTEbgSF/view?usp=sharing

You can also see this post : https://stackoverflow.com/questions/66427526/runtimeerror-expected-one-of-cpu-cuda-mkldnn-opengl-opencl-ideep-hip-msn

If you have any problems, please let me know.
Have a good day!

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

No branches or pull requests

1 participant