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: Attempted to set the storage of a tensor on device "cpu" to a storage on different device "cuda:0". This is no longer allowed; the devices must match. #26

Open
liujiaoshou17 opened this issue May 26, 2023 · 1 comment

Comments

@liujiaoshou17
Copy link

RuntimeError: Attempted to set the storage of a tensor on device "cpu" to a storage on different device "cuda:0". This is no longer allowed; the devices must match.
使用预训练模型为imagenet时会报错,其他预训练模型就可以

@bayuezha
Copy link

在 hub.py里修改最后一行,删去, map_location=map_location

return torch.load(cached_file, weights_only=weights_only)

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

2 participants