用cuda创建的环境 进入python,在import tensorflow as tf 后
出现home/image/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(“resource”, np.ubyte, 1)])
解决方法:cd home/image/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework 回车
然后 打开这个dtypes.py
找到np_resource = np.dtype([(“resource”, np.ubyte, 1)])
把它改为:np_resource = np.dtype([(“resource”, np.ubyte, (1,))])
看清楚该的位置 ,把1 改为(1,) 。
注意:逗号 和句点的区别
之后 就OK了
如果继续出现类似错误 ,请查看我 的优快云博客,有详细解决方案