davin11 / CNN-NLM

Nonlocal CNN SAR Image Despeckling
Other
17 stars 6 forks source link

cupy install error #2

Closed wykhan closed 3 months ago

wykhan commented 3 years ago

I'm very interested in your work, but I have a problem in the reproduction. install cupy failed: "pip install cupy==6.2.0" "ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-gf03bx31/cupy/"

Do u have any suggestions?

conda env create -n env_cnn_nlm -f environment.yml Collecting package metadata (repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 4.7.10 latest version: 4.10.1

Please update conda by running

$ conda update -n base -c defaults conda

Downloading and Extracting Packages pip-19.1.1 | 1.6 MB | ############################################# | 100% numpy-base-1.16.4 | 3.5 MB | ############################################# | 100% scipy-1.2.1 | 13.7 MB | ############################################# | 100% wheel-0.33.4 | 41 KB | ############################################# | 100% cudnn-7.2.1 | 241.6 MB | ############################################# | 100% certifi-2019.6.16 | 152 KB | ############################################# | 100% cython-0.28.2 | 2.9 MB | ############################################# | 100% torchvision-0.2.1 | 75 KB | ############################################# | 100% mkl_fft-1.0.12 | 155 KB | ############################################# | 100% scikit-learn-0.21.2 | 5.0 MB | ############################################# | 100% mkl_random-1.0.2 | 362 KB | ############################################# | 100% ca-certificates-2019 | 126 KB | ############################################# | 100% h5py-2.9.0 | 993 KB | ############################################# | 100% imageio-2.5.0 | 3.2 MB | ############################################# | 100% pytorch-0.4.1 | 432.0 MB | ############################################# | 100% pyparsing-2.4.2 | 62 KB | ############################################# | 100% pillow-6.1.0 | 582 KB | ############################################# | 100% cuda92-1.0 | 4 KB | ############################################# | 100% setuptools-41.0.1 | 505 KB | ############################################# | 100% numpy-1.16.4 | 48 KB | ############################################# | 100% pyyaml-5.1.1 | 178 KB | ############################################# | 100% lmdb-0.9.23 | 418 KB | ############################################# | 100% python-3.6.8 | 30.1 MB | ############################################# | 100% openssl-1.1.1d | 2.5 MB | ############################################# | 100% joblib-0.13.2 | 343 KB | ############################################# | 100% pytz-2019.2 | 183 KB | ############################################# | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done Ran pip subprocess with arguments: ['/home/wykhan/.conda/envs/env_cnn_nlm/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/wykhan/Projects/despeckling/CNN-NLM/condaenv.hrso5g66.requirements.txt'] Pip subprocess output: Collecting cupy==6.2.0 (from -r /home/wykhan/Projects/despeckling/CNN-NLM/condaenv.hrso5g66.requirements.txt (line 1)) Downloading https://files.pythonhosted.org/packages/4d/08/2b25443d31ea34cdd259a689d67bc20f19df0c079e1f517ca1bd5bd7e6e2/cupy-6.2.0.tar.gz (3.1MB)

Pip subprocess error: ERROR: Complete output from command python setup.py egg_info: ERROR: Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [], 'wheel_includes': [], 'no_rpath': False, 'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False}

-------- Configuring Module: cuda --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

-------- Configuring Module: cudnn --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/tmp/tmpezmqb6v3/a.cpp:1:10: fatal error: cudnn.h: 没有那个文件或目录
 #include <cudnn.h>
          ^~~~~~~~~
compilation terminated.
command 'gcc' failed with exit status 1

-------- Configuring Module: nccl --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/tmp/tmpj2icmpn6/a.cpp:1:10: fatal error: nccl.h: 没有那个文件或目录
 #include <nccl.h>
          ^~~~~~~~
compilation terminated.
command 'gcc' failed with exit status 1

-------- Configuring Module: cusolver --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

-------- Configuring Module: nvtx --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

-------- Configuring Module: thrust --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

************************************************************
* CuPy Configuration Summary                               *
************************************************************

Build Environment:
  Include directories: ['/usr/local/cuda-11.1/include']
  Library directories: ['/usr/local/cuda-11.1/lib64']
  nvcc command       : ['/usr/local/cuda-11.1/bin/nvcc']

Environment Variables:
  CFLAGS          : (none)
  LDFLAGS         : (none)
  LIBRARY_PATH    : (none)
  CUDA_PATH       : (none)
  NVTOOLSEXT_PATH : (none)
  NVCC            : (none)

Modules:
  cuda      : Yes (version 11010)
  cudnn     : No
    -> Include files not found: ['cudnn.h']
    -> Check your CFLAGS environment variable.
  nccl      : No
    -> Include files not found: ['nccl.h']
    -> Check your CFLAGS environment variable.
  cusolver  : Yes
  nvtx      : Yes
  thrust    : Yes

WARNING: Some modules could not be configured.
CuPy will be installed without these modules.
Please refer to the Installation Guide for details:
https://docs-cupy.chainer.org/en/stable/install.html

************************************************************

Traceback (most recent call last):
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/ssl_support.py", line 174, in connect
    (self.host, self.port), getattr(self, 'source_address', None)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 770, in open_url
    return open_with_auth(url, self.opener)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 965, in _socket_timeout
    return func(*args, **kwargs)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 1084, in open_with_auth
    fp = opener(request)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/ssl_support.py", line 161, in https_open
    lambda host, **kw: VerifyingHTTPSConn(host, self.ca_bundle, **kw), req
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-gf03bx31/cupy/setup.py", line 180, in <module>
    'sdist': sdist},
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
    _install_setup_requires(attrs)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
    replace_conflicting=True,
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/pkg_resources/__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1077, in obtain
    return installer(requirement)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
    return cmd.easy_install(req)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 667, in easy_install
    not self.always_copy, self.local_index
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 659, in fetch_distribution
    dist = find(requirement)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 639, in find
    loc = self.download(dist.location, tmpdir)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 583, in download
    found = self._download_url(scheme.group(1), spec, tmpdir)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 828, in _download_url
    return self._attempt_download(url, filename)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 834, in _attempt_download
    headers = self._download_to(url, filename)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 733, in _download_to
    fp = self.open_url(url)
  File "/home/wykhan/.conda/envs/env_cnn_nlm/lib/python3.6/site-packages/setuptools/package_index.py", line 784, in open_url
    % (url, v.reason))
distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/8e/d1/7c7917271bebbcc88f2adff976d9f58d25648e5614e2724ca188e42f76b7/fastrlock-0.6-cp36-cp36m-manylinux1_x86_64.whl#sha256=a27259e4ab34a09391db2382359f55ff24713d5702fc83e051a3bf3e9e7eaf97: [Errno -2] Name or service not known
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-gf03bx31/cupy/

CondaEnvException: Pip failed

davin11 commented 3 years ago

did you install Cuda 9.2?

davin11 commented 3 years ago

can you try to install the conda env in following way? conda create -n env_cnn_nlm -c nvidia -c pytorch -c conda-forge pytorch=0.4.1 torchvision cupy==6.4.0 cudatoolkit==9.2 cudnn matplotlib scikit-learn pillow tqdm h5py yaml tensorboardx==1.8 fastrlock