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
ImportError: cannot import name 'get_device' from 'basicsr.utils.misc' #193
Comments
In my case: |
I've met the same problem. |
A rude method is just copy the following code into the directory: import torch
def get_device():
if torch.cuda.is_available():
return torch.device("cuda")
else:
return torch.device("cpu")
def gpu_is_available():
return torch.cuda.is_available() Good Luck! |
I added this code to file misc.py and it worked ! |
I did the above method but im now getting |
The problem happens when the module BasicSR is imported. And Python would try to use the module instead of the file with the same name.
To solve the problem, I suggest to change the directory basicsr to another name, like cfbasicsr.
The text was updated successfully, but these errors were encountered: