机器学习/tensorflow
来自康健生活
< 机器学习
引言
tensorflow 分为 CPU 版本和 GPU 版本。
卸载
安装
/home/kangkk
# cpu
pip3 install --user --upgrade tensorflow
# gpu
pip3 install --user --upgrade tensorflow-gpu
验证
[jian@kang /home/kangkk]$
python3 -c "import tensorflow as tf; print(tf.__version__)"
2.7.0
记录设备指派,查看安装的是 CPU 版本还是 GPU 版本。
checkCPUorGPU.py
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
No categories