在 cupy 中执行以下最小示例。
import numpy, cupy, cupyx
print( cupyx.get_runtime_info() )
mydata = numpy.empty((3,), dtype='f')
#gpu = False
gpu = True
if not gpu:
xp = numpy
else:
xp = cupy
mydata_like = xp.zeros_like(mydata)
以下列方式
(venv) user@ailx216:/work/sandbox$ CUDA_PATH=/usr/local/cuda-9.1 python cupy_test.py
给我这个错误:
File "chainer_test.py", line 14, in <module>
mydata_like = xp.zeros_like(mydata)
/cupy/creation/basic.py", line 205, in zeros_like
order, strides, memptr = _new_like_order_and_strides(a, dtype, order)
/cupy/creation/basic.py", line 35, in _new_like_order_and_strides
order = chr(_update_order_char(a, ord(order)))
TypeError: Argument 'x' has incorrect type (expected cupy.core.core.ndarray, got numpy.ndarray)
print( cupyx.get_runtime_info() ) 的输出如下:
CuPy Version : 6.2.0
CUDA Root : /usr/local/cuda-9.1/
CUDA Build Version : 9010
CUDA Driver Version : 10000
CUDA Runtime Version : 9010
cuDNN Build Version : 7102
cuDNN Version : 7102
NCCL Build Version : 2115
NCCL Runtime Version : (unknown)
我该如何调试呢?