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

Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU. #8

Open
sugizo opened this issue Dec 13, 2023 · 1 comment

Comments

@sugizo
Copy link

sugizo commented Dec 13, 2023

env
google colab

code

pip install -U instafilter opencv-python 
import cv2
from instafilter import Instafilter
filtered_img = 'aden.jpg'

model = Instafilter('Aden')
new_image = model(ori_img)

result

RuntimeError                              Traceback (most recent call last)
[<ipython-input-37-0b05f7113c97>](https://localhost:8080/#) in <cell line: 3>()
      1 filtered_img = 'aden.jpg'
      2 
----> 3 model = Instafilter('Aden')
      4 new_image = model(ori_img)
      5 

9 frames
[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in validate_cuda_device(location)
    256 
    257     if not torch.cuda.is_available():
--> 258         raise RuntimeError('Attempting to deserialize object on a CUDA '
    259                            'device but torch.cuda.is_available() is False. '
    260                            'If you are running on a CPU-only machine, '

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

best regards

@thoppe
Copy link
Owner

thoppe commented Dec 15, 2023

If you provide a PR I'll merge it in, but I'm not currently supporting this module.

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