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

mac cuda cpu/gpu issue #2

Open
JonasIsLive opened this issue Mar 28, 2021 · 2 comments
Open

mac cuda cpu/gpu issue #2

JonasIsLive opened this issue Mar 28, 2021 · 2 comments

Comments

@JonasIsLive
Copy link

Im trying to run this on an old macbook pro and keep running into this issue with cuda..
I have a GT 650M graphics card and according to CUDA's support page, it looks like it should run without issues.. but i've also heard before that most mac book pro's don't have a card that supports cuda and that pytorch therefore is installed by default without (for mac).. can you help me understand what to do ? is it my mac, should i upgrade to fix this? (link to cuda page: https://en.wikipedia.org/wiki/CUDA#GPUs_supported)

error code:

eye-contact-cnn % python3 demo.py --video /Users/jonasbjerg/noedit/input/test1.MP4
loading saved model weights
Traceback (most recent call last):
File "demo.py", line 184, in
run(args.video, args.face, args.model_weight, args.jitter, args.save_vis, args.display_off, args.save_text)
File "demo.py", line 101, in run
model = model_static(model_weight)
File "/Users/jonasbjerg/noedit/eye-contact-cnn/model.py", line 11, in model_static
snapshot = torch.load(pretrained)
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 593, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 772, in _legacy_load
result = unpickler.load()
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 728, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 175, in default_restore_location
result = fn(storage, location)
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 151, in _cuda_deserialize
device = validate_cuda_device(location)
File "/opt/anaconda3/lib/python3.8/site-packages/torch/serialization.py", line 135, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
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.

@amna-ai
Copy link

amna-ai commented Oct 9, 2023

I am facing similar issue.
I have changed the code to thid
snapshot = torch.load(model_weight, map_location=torch.device('cpu'))
but still getting the same error you got.

@amirulmsri
Copy link

amirulmsri commented May 6, 2024

the codes run perfectly with the example video you provided but failed with camera or video of my own (in .avi format), is there any explanation for this?

there is no error message, just for both camera and video there's huge delay and tend to crash.

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

3 participants