【那些年跳过的坑】-TensorFlow-GPU安装问题总结

本地安装:

tensorflow-gpu版自己手动下载.whl文件(迅雷下载到本地),放在随便一个文件下,然后进文件夹下搜索cmd,直接pip install 文件名安装gpu版的tensorflow
安装时进入到Anaconda prompt中,并activate tensorflow-gup,在(tensorflow-gup)情况下pip install D:tensorflow……x64.whl。完美。

问题1: 安装完import tensorflow出错no DLL未发现模块什么的……
解决方法:
安装tensorflow1.12.0+cuda9.0+cudnn7.0
tensorflow1.13与cuda9.0不兼容
pip install --ignore-installed --upgrade D:\tensorflow……whl


问题2:正常运行但警告h5py/_init_.py:36问题float to np.floating……
 解决方法tensorflow1.12.0对应numpy为numpy1.13.3,对应h5py为2.8.0(关键)
直接先pip uninstall numpy
后pip install numpy==1.13.1 
然后在Anaconda prompt中(注意不在tensorflow-gup) 中,运行pip install h5py==2.8.0rcl

问题3:ValueError: Object arrays cannot be loaded when allow_pickle=False"
解决方法:原来为numpy1.16.3不兼容
pip uninstall numpy
pip install numpy==1.16.2

问题4:ImportError: numpy.core.multiarray failed to import
解决方法:pip install -U numpy

问题5:GPU报错:Blas GEMM launch failed
解决方法:
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
np.set_printoptions(threshold=np.inf)
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.1
sess = tf.InteractiveSession(config=config)

 

问题6:重新安装TensorFlow的其他版本

直接在Anaconda prompt输入activate tensorflow-gup进入TensorFlow环境,输入pip install tensorflow-gpu==版本(如1.10.0)

 

问题7:出现问题

1.12.0 2019-01-08 16:33:09.754553: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2019-01-08 16:33:10.292044: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: name: GeForce GTX 860M major: 5 minor: 0 memoryClockRate(GHz): 1.0195 pciBusID: 0000:01:00.0 totalMemory: 2.00GiB freeMemory: 1.64GiB 2019-01-08 16:33:10.292547: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0 2019-01-08 16:33:11.477348: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-01-08 16:33:11.477676: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 2019-01-08 16:33:11.477844: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N 2019-01-08 16:33:11.478190: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1392 MB memory) -> physical GPU (device: 0, name: GeForce GTX 860M, pci bus id: 0000:01:00.0, compute capability: 5.0) 2019-01-08 16:33:11.884790: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:666] Iteration = 0, topological sort failed with message: The graph couldn't be sorted in topological order. 2019-01-08 16:33:11.889780: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:666] Iteration = 1, topological sort failed with message: The graph couldn't be sorted in topological order. 2019-01-08 16:33:11.917830: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:666] Iteration = 0, topological sort failed with message: The graph couldn't be sorted in topological order. 2019-01-08 16:33:11.920831: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:666] Iteration = 1, topological sort failed with message: The graph couldn't be sorted in topological order.

 

 

 更改TensorFlow版本为1.10.0, 这是tensorflow 1.12.0.的一个BUG。

 

你可能感兴趣的:(深度学习)