Install TensorFlow 2
TensorFlow is tested and supported on the following 64-bit systems:Python 3.5–3.7
Ubuntu 16.04 or later
Windows 7 or laterTensorFlow 2 packages require a pip version >19.0.
目前TensorFlow在python3 只支持3.5-3.7版本,pip版本需要大于19.0
我的系统win10,python3.6
安装老是失败,失败的模块whl单独安装
我装失败了这个,然后我下载了它的whl
pip install
grpcio-1.28.1-cp36-cp36m-win_amd64.whl
装完后,在装
pip install
tensorflow-2.1.0-cp36-cp36m-win_amd64.whl
完成之后显示:
Successfully installed absl-py-0.9.0 astor-0.8.1 cachetools-4.1.0 certifi-2020.4.5.1 chardet-3.0.4 gast-0.2.2 google-auth-1.14.0 google-auth-oauthlib-0.4.1 google-pasta-0.2.0 h5py-2.10.0 idna-2.9 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.2.1 numpy-1.18.2 oauthlib-3.1.0 opt-einsum-3.2.1 protobuf-3.11.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.23.0 requests-oauthlib-1.3.0 rsa-4.0 scipy-1.4.1 setuptools-46.1.3 tensorboard-2.1.1 tensorflow-2.1.0 tensorflow-estimator-2.1.0 termcolor-1.1.0 urllib3-1.25.9 werkzeug-1.0.1 wrapt-1.12.1
pip list如下
Package Version
-------------------- ----------
absl-py 0.9.0
astor 0.8.1
cachetools 4.1.0
certifi 2020.4.5.1
chardet 3.0.4
gast 0.2.2
google-auth 1.14.0
google-auth-oauthlib 0.4.1
google-pasta 0.2.0
grpcio 1.28.1
h5py 2.10.0
idna 2.9
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
Markdown 3.2.1
numpy 1.18.2
oauthlib 3.1.0
opt-einsum 3.2.1
pip 20.0.2
protobuf 3.11.3
pyasn1 0.4.8
pyasn1-modules 0.2.8
requests 2.23.0
requests-oauthlib 1.3.0
rsa 4.0
scipy 1.4.1
setuptools 46.1.3
six 1.14.0
tensorboard 2.1.1
tensorflow 2.1.0
tensorflow-estimator 2.1.0
termcolor 1.1.0
urllib3 1.25.9
Werkzeug 1.0.1
wheel 0.29.0
wincertstore 0.2
wrapt 1.12.1
测试是否安装成功
>>> import tensorflow as tf
>>> print(tf.reduce_sum(tf.random.normal([1000, 1000])))
tf.Tensor(910.61707, shape=(), dtype=float32)
网友评论