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

Error while installing torchlars (pip install torchlars) #11

Open
kaushal-py opened this issue Sep 16, 2020 · 2 comments
Open

Error while installing torchlars (pip install torchlars) #11

kaushal-py opened this issue Sep 16, 2020 · 2 comments

Comments

@kaushal-py
Copy link

I am runnning a conda environment (python=3.8) with pytorch 1.6 installed on Ubuntu 18.04. I get the following error when I run pip install torchlars. How can I fix this?

(pytorch16) ➜  csl-project git:(master) ✗ pip install torchlars
Collecting torchlars
  Using cached torchlars-0.1.2.tar.gz (6.5 kB)
    ERROR: Command errored out with exit status 1:
     command: /sdb1/kaushal/miniconda3/envs/pytorch16/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xvy_whov/torchlars/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xvy_whov/torchlars/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-3jm12ya0
         cwd: /tmp/pip-install-xvy_whov/torchlars/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-xvy_whov/torchlars/setup.py", line 21, in <module>
        CUDAExtension('torchlars._adaptive_lr', [
      File "/sdb1/kaushal/miniconda3/envs/pytorch16/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 779, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/sdb1/kaushal/miniconda3/envs/pytorch16/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 869, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/sdb1/kaushal/miniconda3/envs/pytorch16/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1783, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@ivanpuhachov
Copy link

First of all, does your pytorch see cuda? Try:

import torch
print (torch.cuda.is_available)

If it does see, then set up the CUDA_HOME path as its ask you to do it. My cuda folder is located in /usr/lib/cuda/ so:

export CUDA_HOME=/usr/lib/cuda

@kaushal-py
Copy link
Author

Thanks, separately installing CUDA fixed it. I guess the cudatoolkit that comes along with pytorch is not sufficient. Though this left me wondering if it Is possible to remove this dependency? Shouldn't the pytorch be sufficient by itself.

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