我刚刚使用 conda 在 Win-10 上安装了 cupy v-6,conda install -c anaconda cupy安装进展顺利,我的 cuda 版本是 10.1,Python 3.7.4,
当我运行以下代码时,出现错误:AttributeError: module 'cupy' has no attribute 'array'
打印目录结果:
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'cp', 'np']
编辑:
完全错误
Traceback (most recent call last):
File "D:\code\cupy.py", line 2, in <module>
import cupy as cp
File "D:\code\cupy.py", line 4, in <module>
x_gpu = cp.array([1, 2, 3])
AttributeError: module 'cupy' has no attribute 'array'`
The code:
我的代码
import numpy as np
import cupy as cp
x_gpu = cp.array([1, 2, 3])
婷婷同学_
相关分类