TensorFlow 安装与环境配置

另附 nvidia-smi 和 conda list 的结果:

Fri May  8 11:25:59 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.50       Driver Version: 430.50       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla V100-PCIE...  Off  | 00000000:89:00.0 Off |                    0 |
| N/A   40C    P0    37W / 250W |   1354MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  Tesla V100-PCIE...  Off  | 00000000:8A:00.0 Off |                    0 |
| N/A   39C    P0    38W / 250W |    320MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  Tesla V100-PCIE...  Off  | 00000000:8B:00.0 Off |                    0 |
| N/A   39C    P0    36W / 250W |    320MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  Tesla V100-PCIE...  Off  | 00000000:8C:00.0 Off |                    0 |
| N/A   43C    P0    49W / 250W |  18828MiB / 32510MiB |     65%      Default |
+-------------------------------+----------------------+----------------------+
|   4  Tesla V100-PCIE...  Off  | 00000000:DA:00.0 Off |                    0 |
| N/A   40C    P0    46W / 250W |  18828MiB / 32510MiB |     73%      Default |
+-------------------------------+----------------------+----------------------+
|   5  Tesla V100-PCIE...  Off  | 00000000:DB:00.0 Off |                    0 |
| N/A   38C    P0    39W / 250W |    320MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   6  Tesla V100-PCIE...  Off  | 00000000:DC:00.0 Off |                    0 |
| N/A   64C    P0   155W / 250W |   5789MiB / 32510MiB |     86%      Default |
+-------------------------------+----------------------+----------------------+
|   7  Tesla V100-PCIE...  Off  | 00000000:DD:00.0 Off |                    0 |
| N/A   40C    P0    40W / 250W |    320MiB / 32510MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2234      G   /usr/bin/X                                    22MiB |
|    0     83392      C   /usr/lhy/anaconda3/envs/tf2/bin/python       363MiB |
|    0    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       955MiB |
|    1    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    2    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    3    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    3    139517      C   python                                      4627MiB |
|    3    140633      C   python                                      4627MiB |
|    3    142274      C   python                                      4627MiB |
|    3    143266      C   python                                      4627MiB |
|    4    133393      C   python                                      4627MiB |
|    4    133906      C   python                                      4627MiB |
|    4    134679      C   python                                      4627MiB |
|    4    135379      C   python                                      4627MiB |
|    4    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    5    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    6     15156      C   python                                      5469MiB |
|    6    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
|    7    135660      C   /usr/lhy/anaconda3/envs/tf2/bin/python       307MiB |
+-----------------------------------------------------------------------------+
# packages in environment at /usr/lhy/anaconda3/envs/tf2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
absl-py                   0.9.0                    pypi_0    pypi
astor                     0.8.1                    pypi_0    pypi
attrs                     19.3.0                   pypi_0    pypi
backcall                  0.1.0                    py37_0    defaults
bleach                    3.1.4                    pypi_0    pypi
ca-certificates           2020.1.1                      0    defaults
cachetools                4.1.0                    pypi_0    pypi
certifi                   2020.4.5.1               py37_0    defaults
chardet                   3.0.4                    pypi_0    pypi
cloudpickle               1.3.0                    pypi_0    pypi
cudatoolkit               10.1.243             h6bb024c_0    defaults
cudnn                     7.6.5                cuda10.1_0    defaults
cycler                    0.10.0                   pypi_0    pypi
decorator                 4.4.2                      py_0    defaults
defusedxml                0.6.0                    pypi_0    pypi
entrypoints               0.3                      pypi_0    pypi
gast                      0.2.2                    pypi_0    pypi
gin-config                0.1.3                    pypi_0    pypi
google-auth               1.14.0                   pypi_0    pypi
google-auth-oauthlib      0.4.1                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
grpcio                    1.28.1                   pypi_0    pypi
gym                       0.10.11                  pypi_0    pypi
h5py                      2.10.0                   pypi_0    pypi
idna                      2.9                      pypi_0    pypi
importlib-metadata        1.6.0                    pypi_0    pypi
ipykernel                 5.2.1                    pypi_0    pypi
ipython                   7.13.0           py37h5ca1d4c_0    defaults
ipython-genutils          0.2.0                    pypi_0    pypi
ipython_genutils          0.2.0                    py37_0    defaults
jedi                      0.17.0                   pypi_0    pypi
jinja2                    2.11.2                   pypi_0    pypi
joblib                    0.14.1                   pypi_0    pypi
json5                     0.9.4                    pypi_0    pypi
jsonschema                3.2.0                    pypi_0    pypi
jupyter-client            6.1.3                    pypi_0    pypi
jupyter_client            6.1.2                      py_0    defaults
jupyter_core              4.6.3                    py37_0    defaults
jupyterlab                2.1.0                    pypi_0    pypi
jupyterlab-server         1.1.1                    pypi_0    pypi
keras-applications        1.0.8                    pypi_0    pypi
keras-preprocessing       1.1.0                    pypi_0    pypi
kiwisolver                1.2.0                    pypi_0    pypi
ld_impl_linux-64          2.33.1               h53a641e_7    defaults
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 9.1.0                hdf63c60_0    defaults
libsodium                 1.0.16               h1bed415_0    defaults
libstdcxx-ng              9.1.0                hdf63c60_0    defaults
lightgbm                  2.3.1                    pypi_0    pypi
markdown                  3.2.1                    pypi_0    pypi
markupsafe                1.1.1                    pypi_0    pypi
matplotlib                3.2.1                    pypi_0    pypi
minepy                    1.2.4                    pypi_0    pypi
mistune                   0.8.4                    pypi_0    pypi
nbconvert                 5.6.1                    pypi_0    pypi
nbformat                  5.0.6                    pypi_0    pypi
ncurses                   6.2                  he6710b0_0    defaults
notebook                  6.0.3                    pypi_0    pypi
numpy                     1.18.3                   pypi_0    pypi
oauthlib                  3.1.0                    pypi_0    pypi
openssl                   1.1.1g               h7b6447c_0    defaults
opt-einsum                3.2.1                    pypi_0    pypi
pandas                    1.0.3                    pypi_0    pypi
pandocfilters             1.4.2                    pypi_0    pypi
parso                     0.7.0                    pypi_0    pypi
pexpect                   4.8.0                    py37_0    defaults
pickleshare               0.7.5                    pypi_0    pypi
pip                       20.0.2                   py37_1    defaults
prometheus-client         0.7.1                    pypi_0    pypi
prompt-toolkit            3.0.5                    pypi_0    pypi
prompt_toolkit            3.0.4                         0    defaults
protobuf                  3.11.3                   pypi_0    pypi
ptyprocess                0.6.0                    pypi_0    pypi
pyaml                     20.4.0                   pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pydot                     1.4.1                    pypi_0    pypi
pyglet                    1.5.4                    pypi_0    pypi
pygments                  2.6.1                      py_0    defaults
pyparsing                 2.4.7                    pypi_0    pypi
pyrsistent                0.16.0                   pypi_0    pypi
python                    3.7.7           hcf32534_0_cpython    defaults
python-dateutil           2.8.1                      py_0    defaults
python-graphviz           0.14                     pypi_0    pypi
pytz                      2019.3                   pypi_0    pypi
pyyaml                    5.3.1                    pypi_0    pypi
pyzmq                     19.0.0                   pypi_0    pypi
readline                  8.0                  h7b6447c_0    defaults
requests                  2.23.0                   pypi_0    pypi
requests-oauthlib         1.3.0                    pypi_0    pypi
rsa                       4.0                      pypi_0    pypi
scikit-learn              0.22.2.post1             pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
send2trash                1.5.0                    pypi_0    pypi
setuptools                46.1.3                   py37_0    defaults
six                       1.14.0                   py37_0    defaults
SQLite                    3.31.1               h7b6447c_0    defaults
tensorboard               2.1.1                    pypi_0    pypi
tensorflow                2.1.0                    pypi_0    pypi
tensorflow-addons         0.9.1                    pypi_0    pypi
tensorflow-estimator      2.1.0                    pypi_0    pypi
tensorflow-probability    0.9.0                    pypi_0    pypi
termcolor                 1.1.0                    pypi_0    pypi
terminado                 0.8.3                    pypi_0    pypi
testpath                  0.4.4                    pypi_0    pypi
tf-agents                 0.4.0                    pypi_0    pypi
tk                        8.6.8                hbc83047_0    defaults
tornado                   6.0.4            py37h7b6447c_1    defaults
tqdm                      4.45.0                   pypi_0    pypi
traitlets                 4.3.3                    py37_0    defaults
typeguard                 2.7.1                    pypi_0    pypi
urllib3                   1.25.9                   pypi_0    pypi
wcwidth                   0.1.9                      py_0    defaults
webencodings              0.5.1                    pypi_0    pypi
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py37_0    defaults
wrapt                     1.12.1                   pypi_0    pypi
xgboost                   0.80                     pypi_0    pypi
xz                        5.2.5                h7b6447c_0    defaults
zeromq                    4.3.1                he6710b0_3    defaults
zipp                      3.1.0                    pypi_0    pypi
zlib                      1.2.11               h7b6447c_3    defaults