1

I am trying to run neural network on chainer by GPU. but it seems to be just not working. I tried some version of cuda already, 9.0, 10.1, 10.0. Before I had some problem cupy installation. Now I am just install cupy through Anaconda environment. cuda.to_gpu and cupy.array seems to work

I have no clue about the problem now.

    Exception in main training loop: module 'cupy.cudnn' has no attribute 'softmax_forward'
Traceback (most recent call last):
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\training\trainer.py", line 315, in run
    update()
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\training\updaters\standard_updater.py", line 165, in update
    self.update_core()
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\training\updaters\standard_updater.py", line 177, in update_core
    optimizer.update(loss_func, *in_arrays)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\optimizer.py", line 680, in update
    loss = lossfun(*args, **kwds)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\link.py", line 242, in __call__
    out = forward(*args, **kwargs)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\links\model\classifier.py", line 144, in forward
    self.loss = self.lossfun(self.y, t)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\functions\loss\softmax_cross_entropy.py", line 382, in softmax_cross_entropy
    normalize, cache_score, class_weight, ignore_label, reduce)(x, t)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\function.py", line 233, in __call__
    ret = node.apply(inputs)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\function_node.py", line 263, in apply
    outputs = self.forward(in_data)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\function.py", line 135, in forward
    return self._function.forward(inputs)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\function.py", line 340, in forward
    return self.forward_gpu(inputs)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\functions\loss\softmax_cross_entropy.py", line 127, in forward_gpu
    log_y = log_softmax._log_softmax(x)
  File "C:\Users\81065\Anaconda3\lib\site-packages\chainer\functions\activation\log_softmax.py", line 30, in _log_softmax
    return cudnn.softmax_forward(x, axis, _algorithm)
Will finalize trainer extensions and updater before reraising the exception.


    AttributeError                            Traceback (most recent call last)

And the error said:

module 'cupy.cudnn' has no attribute 'softmax_forward'

The info from chainer.print_runtime_info() is bellowed.

Platform: Windows-10-10.0.17763-SP0
Chainer: 5.3.0
NumPy: 1.13.3
CuPy:
  CuPy Version          : 4.1.0
  CUDA Root             : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
  CUDA Build Version    : 9000
  CUDA Driver Version   : 10010
  CUDA Runtime Version  : 9000
  cuDNN Build Version   : 7104
  cuDNN Version         : 7402
  NCCL Build Version    : None
iDeep: Not Available

AttributeError: module 'cupy.cudnn' has no attribute 'softmax_forward'

Followed by @corochann suggestion. I have reinstall and update chainer, but now I cant install cupy. below is chainer.print_runtime_info().

Platform: Windows-10-10.0.17763-SP0
Chainer: 5.3.0
NumPy: 1.13.3
CuPy: Not Available
iDeep: Not Available
None

When I try to install cupy. the bellowed happened.

Build Environment:
      Include directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\include', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\include']
      Library directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\lib\\x64', 'C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\lib\\x64']
      nvcc command       : ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin/nvcc.exe']

    Environment Variables:
      CFLAGS          : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\
      LDFLAGS         : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\
      LIBRARY_PATH    : (none)
      CUDA_PATH       : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
      NVTOOLSEXT_PATH : C:\Program Files\NVIDIA Corporation\NvToolsExt\
      NVCC            : (none)

    Modules:
      cuda      : No
        -> Include files not found: ['cublas_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\81065\AppData\Local\Temp\pip-install-73rgt_6r\cupy\setup.py", line 120, in <module>
        ext_modules = cupy_setup_build.get_ext_modules()
      File "C:\Users\81065\AppData\Local\Temp\pip-install-73rgt_6r\cupy\cupy_setup_build.py", line 588, in get_ext_modules
        extensions = make_extensions(arg_options, compiler, use_cython)
      File "C:\Users\81065\AppData\Local\Temp\pip-install-73rgt_6r\cupy\cupy_setup_build.py", line 384, 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\81065\AppData\Local\Temp\pip-install-73rgt_6r\cupy\
Dale Lin
  • 11
  • 3
  • 1
    It seems your Chainer & Cupy version mismatches. Can you try `pip uninstall cupy` and `pip install cupy-cuda90==5.3.0 --no-cache-dir` to install same version of cupy & chainer? – corochann Mar 22 '19 at 00:54
  • I uninstall cupy and updated the chainer. However, I fail to reinstall the cupy. 'Platform: Windows-10-10.0.17763-SP0 Chainer: 5.3.0 NumPy: 1.13.3 CuPy: Not Available iDeep: Not Available None' – Dale Lin Mar 22 '19 at 02:19
  • Command "python setup.py egg_info" failed with error code 1 in C:\Users\81065\AppData\Local\Temp\pip-install-0ay7h8s8\cupy\. This is the error I received when I use pip install cupy – Dale Lin Mar 22 '19 at 02:21
  • @DaleLin Did you follow the instruction of @corochann? He said `cupy-cuda90==5.3.0`, not `cupy`. – Yuki Hashimoto Mar 22 '19 at 02:22
  • @DaleLin Also Windows is not (officially) supported. (https://docs-cupy.chainer.org/en/stable/install.html#recommended-environments) – Yuki Hashimoto Mar 22 '19 at 02:25
  • @Yuki Hashimoto, I did the comment cupy-cuda90==5.3.0. so mine chainer is update to 5.3.0. But now the info mention CuPy is not available. – Dale Lin Mar 22 '19 at 02:52
  • @DaleLin OK, thanks for your cooperation. Could you check whether there is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\cuda.h? – Yuki Hashimoto Mar 22 '19 at 05:31
  • @Yuki Hashimoto, yes, the file is exist in there. – Dale Lin Mar 22 '19 at 16:12
  • @DaleLin Sorry for the late reply. Have you checked whether _all_ of the files listed in the error is in that directory? – Yuki Hashimoto Mar 26 '19 at 05:46

1 Answers1

2

As mentioned by @corochann, this is caused by the version mismatch between chainer and cupy. cupy==v4.1.0 does not hold cupy.cudnn.softmax_forward.

You can find it by comparing the source code of v5.3.0 and v4.1.0.

Yuki Hashimoto
  • 1,013
  • 7
  • 19