No module name 'cupy' when OpenPose tries to run on GPU

Asked 2 years ago, Updated 2 years ago, 130 views

I am trying to open pose by referring to the following site.
https://github.com/DeNA/Chainer_Realtime_Multi-Person_Pose_Estimation/blob/master/README_JP.md
The CPU worked fine, but the operation was so slow that I tried to make it work with the GPU, but the following error occurred.Thank you for your cooperation.

Windows 7
chain 4.0.0
anaconda 1.8.3
cuda Installed
cuDNN Installed

Below is the error message.

 (OpenPose) C:\Users\Username\Documents\open_pose\Chainer_Realtime_Multi-P
person_Pose_Estimation>python pose_detector.py posenet models/coco_posenet.npz --
img data/person.png --gpu0
Loading the model...
Traceback (most recent call last):
  File "pose_detector.py", line 568, in<module>
    pose_detector=PoseDetector(args.arch, args.weights, device=args.gpu, preci
se=args.precise)
  File "pose_detector.py", line 30, in __init__
    cuda.get_device_from_id(device).use()
  File "C:\Users\Username\Anaconda3\envs\OpenPose\lib\site-packages\chain
er\backends\cuda.py", line 160, inget_device_from_id
    check_cuda_available()
  File "C:\Users\Username\Anaconda3\envs\OpenPose\lib\site-packages\chain
er\backends\cuda.py", line 90, check_cuda_available
    raise RuntimeError(msg)
RuntimeError: CUDA environment is not correctly set up
(see https://github.com/chainer/chainer#installation).No module named 'cupy'

(OpenPose) C:\Users\Username\Documents\open_pose\Chainer_Realtime_Multi-P
person_Pose_Estimation> pip install cupy
Collecting cupy
  Using cached https://files.pythonhosted.org/packages/38/14/ddb1a13f77a50d72181
4e28181ae90e0d57c3f8d4faa9a7b2e028cfcc99a/cupy-4.0.0.tar.gz
    Complete output from command python setup.py eg_info:
    **************************************************
    *** WARNING—Cannot find nvToolsExt.nvtx was disabled.
    **************************************************
    Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [ ]
, 'no_rpath': False, 'profile': False, 'linetrace': False, 'notate': False, 'n
o_cuda': False}

    -------- Configuring Module: cuda ---------
    Microsoft Visual C++ 14.0 is required.Get it with "Microsoft Visual C++ Bui
ld Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

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

    Build Environment:
      Include directors: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CU
DA\\v9.1\\include', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\include'
]
      Library directors: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CU
DA\\v9.1\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.1\li
b\\x64', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\lib\\x64' ]
      nvcc command: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CU
DA\\v9.1\\bin/nvcc.exe']

    Environment Variables:
      CFLAGS: (none)
      LDFLAGS: (none)
      LIBRARY_PATH: (none)
      CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
      NVCC: (none)

    Modules:
      cuda —No.
        ->Include files not found: ['cubras_v2.h', 'cuda.h', 'cuda_profiler_api]
.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h', 'nvrtc.h']
        ->Check your CFLAGS environment variable.

    ERROR:CUDA could not be found on your system.
    Please refer to the Installation Guide for details:
    https://docs-cupy.chainer.org/en/stable/install.html

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

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Username\AppData\Local\Temp\pip-install-dgapbvnt\cupy\setup
.py", line 65, in <module>
        ext_modules=cupy_setup_build.get_ext_modules()
      File "C:\Users\Username\AppData\Local\Temp\pip-install-dgapbvnt\cupy\cupy_
setup_build.py", line561, inget_ext_modules
        extensions=make_extensions(arg_options, compiler, use_cython)
      File "C:\Users\Username\AppData\Local\Temp\pip-install-dgapbvnt\cupy\cupy_
setup_build.py", line374, in make_extensions
        raise Exception('Your CUDA environment is invalid.'
    Exception: Your CUDA environment is invalid. Please check above error log.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\username
\AppData\Local\Temp\pipe-install-dgapbvnt\cupy\

python deep-learning chainer

2022-09-30 21:28

1 Answers

"cuda Installed"

RuntimeError: CUDA environment is not correctly set up
(see https://github.com/chainer/chainer#installation).No module named 'cupy'

[Direct translation]
CUDA environment is not set up correctly.
See https://github.com/chainer/chainer#installation.
The 'cupy' module is missing.

Unfortunately, cupy does not seem to be installed properly, so why don't you set up CUDA and install cupy as described in the URL below?

https://github.com/chainer/chainer#installation


2022-09-30 21:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.