文章目录
tensorflow-keras-pytorch-cuda-cudnn版本[不定期更新]
官网
cuda(cudaToolkit)与NVIDIA显卡驱动的版本关系
tensorflow-gpu与cuda、cudnn的版本关系
tensorflow-keras-cuda-cudnn
1. tensorflow=1.3.0 keras=2.1.2
tensorflow 1.3.0 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
tensorflow-base 1.3.0 py36h5293eaa_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
tensorflow-tensorboard 1.5.1 py36hf484d3e_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainkeras 2.1.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda install keras
conda install keras=2.1.2
2. tensorflow=1.12 keras=2.2.4 cuda=9.2 cudnn=7.6.5
numpy为1.16
tensorflow-gpu]-cuda-cudnn
pytorch-cuda-cudnn
note
tensorflow1.12;keras2.2.4;
不需用.compat.v1
,到了tensorflow1.14;keras2.2.5
需要
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
# config.gpu_options.allow_growth = False
sess = tf.compat.v1.Session(config=config)
KTF.set_session(sess)
# Helper functions
# K.set_image_dim_ordering('tf') # 1.12-2.2.4可用
# data_format:字符串。'channels_first'或'channels_last'
K.set_image_data_format('channels_last')
error
ModuleNotFoundError: No module named ‘tensorflow.python.eager’
**前提:**conda默认安装keras,即conda install keras
环境:
backports anaconda/pkgs/main/noarch::backports-1.0-pyhd3eb1b0_2
backports.weakref anaconda/pkgs/free/linux-64::backports.weakref-1.0rc1-py36_0
bleach anaconda/pkgs/free/linux-64::bleach-1.5.0-py36_0
h5py anaconda/pkgs/main/linux-64::h5py-2.10.0-py36hd6299e0_1
hdf5 anaconda/pkgs/main/linux-64::hdf5-1.10.6-hb1b8bf9_0
html5lib anaconda/pkgs/free/linux-64::html5lib-0.9999999-py36_0
importlib-metadata anaconda/pkgs/main/noarch::importlib-metadata-2.0.0-py_1
keras anaconda/pkgs/main/linux-64::keras-2.3.1-0 #########################################
keras-applications anaconda/pkgs/main/noarch::keras-applications-1.0.8-py_1
keras-base anaconda/pkgs/main/linux-64::keras-base-2.3.1-py36_0
keras-preprocessi~ anaconda/pkgs/main/noarch::keras-preprocessing-1.1.0-py_1
libprotobuf anaconda/pkgs/main/linux-64::libprotobuf-3.13.0.1-hd408876_0
markdown anaconda/pkgs/main/linux-64::markdown-3.3.3-py36h06a4308_0
protobuf anaconda/pkgs/main/linux-64::protobuf-3.13.0.1-py36he6710b0_1
pyyaml anaconda/pkgs/main/linux-64::pyyaml-5.3.1-py36h7b6447c_1
tensorflow anaconda/pkgs/free/linux-64::tensorflow-1.3.0-0 ###########################################
tensorflow-base anaconda/pkgs/free/linux-64::tensorflow-base-1.3.0-py36h5293eaa_1
tensorflow-tensor~ anaconda/pkgs/main/linux-64::tensorflow-tensorboard-1.5.1-py36hf484d3e_1
werkzeug anaconda/pkgs/main/noarch::werkzeug-1.0.1-py_0
yaml anaconda/pkgs/main/linux-64::yaml-0.2.5-h7b6447c_0
zipp anaconda/pkgs/main/noarch::zipp-3.4.0-pyhd3eb1b0_0
报错:
ModuleNotFoundError: No module named 'tensorflow.python.eager
解决:
tensorflow提示:No module named ''tensorflow.python.eager".
conda install keras=2.1.2