https://github.com/zq2599/blog_demos
内容:所有原创文章分类汇总及配套源码,涉及Java、Docker、Kubernetes、DevOPS等;
注意:接下来的所有操作并未使用root账号
下载anaconda3,地址:https://www.anaconda.com/products/individual,如下图,可见官方最新版本对应的Python是3.8,符合前面的TensorFlow版本匹配表中的Python版本,所以,就下载最新版吧(此刻是2021.05版)
chmod a+x Anaconda3-2021.05-Linux-x86_64.sh
bash Anaconda3-2021.05-Linux-x86_64.sh
(base) will@ubuntu-hp:~$ python Python 3.8.8 (default, Apr 13 2021, 19:58:26) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.
conda create -n py38 python=3.8.8
conda activate py38
pip install tensorflow-gpu==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install cudatoolkit=10.1 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
conda install cudnn=7.6.5
(base) will@ubuntu-hp:~$ conda info --e # conda environments: # base * /home/will/anaconda3 py38 /home/will/anaconda3/envs/py38
import tensorflow as tf
2021-10-08 23:08:55.391471: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
tf.test.is_built_with_cuda()
tf.test.is_gpu_available()
2021-10-08 23:09:34.367795: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2021-10-08 23:09:34.368110: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1402] Created TensorFlow device (/device:GPU:0 with 5088 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0, compute capability: 6.1) True
我是欣宸,期待与您一同畅游Java世界…
https://github.com/zq2599/blog_demos