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

Gpu Recognition #5

Open
rnorlund opened this issue Aug 28, 2023 · 1 comment
Open

Gpu Recognition #5

rnorlund opened this issue Aug 28, 2023 · 1 comment

Comments

@rnorlund
Copy link

Hello,
I used Anaconda Navigator to setup an env with Python 3.6.13 and torch 1.5.0 and get the following error. Notably, CUDA is True and the GPU is available.
Advice appreciated.
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/truenet", line 4, in
import('pkg_resources').run_script('truenet==1.0.1', 'truenet')
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 708, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1528, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/EGG-INFO/scripts/truenet", line 156, in
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_commands.py", line 277, in evaluate
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/true_net/truenet_test_function.py", line 98, in main
File "/usr/local/lib/python3.11/dist-packages/truenet-1.0.1-py3.11.egg/truenet/utils/truenet_utils.py", line 65, in loading_model
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 795, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 1012, in _legacy_load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 958, in persistent_load
wrap_storage=restore_location(obj, location),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 215, in default_restore_location
result = fn(storage, location)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/torch/serialization.py", line 166, 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.
(truenet) roger@roger:~$ python3.6
Python 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import torch
print("CUDA available: ", torch.cuda.is_available())
CUDA available: True
print("Number of GPUs available: ", torch.cuda.device_count())
Number of GPUs available: 1

@rnorlund
Copy link
Author

This seems to have resolved after reinstalling using sudo python setup.py install (as opposed to the non-sudo version).

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