windows下直接安装,最好勾上python加入系统路径。
查看及安装tensorflow依赖
查看cuda版本(机器支持gpu的不考虑) cat /usr/local/cuda/version.txt
cuda版本及其对应tf版本:
[经过测试的构建配置]
查看python版本
python -V
安装python环境anaconda参考[python虚拟环境安装和配置]
安装最新版本或指定:
pip install tensorflow #pip install tensorflow==
检测已安装带gpu的版本
$pip3 show tensorflow-gpu
安装带gpu的老版本:
pip3 install --upgrade --force-reinstall tensorflow-gpu==1.10.1
pip3 install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.12.0-cp36-cp36m-linux_x86_64.whl
低版本下载地址在这里[https://pypi.org/project/tensorflow-gpu/1.12.2/#files] Note: 1 安装的tensorflow版本要和python对应,否则出错:tensorflow_gpu-1.12.0-cp...m-linux_x86_64.whl is not a supported wheel on this platform。
2 安装的tensorflow版本也要和cuda版本相对应,否则出错:tenforflow ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found stackoverflow。
3 tensorflow_gpu版本太高,如1.12,会报错Failed to get convolution algorithm. cudnn failed to initialize…。目前版本的TensorFlow的ObjectDection中,使用tensorflow-gpu ==1.12 版本会报错,如上,将版本降到tensorflow-gpu ==1.9.0即可正常运行。pip3 install --upgrade --force-reinstall tensorflow-gpu==1.10.1
4 tensorflow-gpu版本太低,如1.9,也会报错:tensorflow-gpu 1.9.0 module 'tensorflow.contrib.estimator' has no attribute 'stop_if_no_increase_hook',这个模块在1.10以上版本才有,所以需要权衡一下再安装。
[安装 TensorFlow]
pip install git+https://github.com/guillaumegenthial/tf_metrics.git from: -柚子皮-
ref: