1.下载安装anaconda,pycharm。不做介绍啦
2.用管理员运行anaconda prompt
3.创建虚拟环境:
conda create --name tf2.10 python=3.8
4.激活虚拟环境:
conda activate tf2.10
5.安装tensorflow-gpu,keras:
pip install tensorflow-gpu==2.10.0 keras==2.10.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
6.安装依赖库
pip install opencv-python==4.4.0.44 pillow==8.2 numpy==1.21 matplotlib scipy pandas scikit-learn tqdm imutils PyYAML tensorboard seaborn protobuf==3.20 chardet -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
7.具体为
opencv-python==4.4.0.44
pillow==8.2
numpy==1.21
matplotlib
scipy
pandas
scikit-learn
tqdm
imutils
PyYAML
tensorboard
seaborn
protobuf==3.20
chardet
8.配置pycharm
1)conda可执行文件在conda安装目录下找到conda.bat就行
2) 设置终端,文件->设置->工具->终端->Shell路径选择cmd.exe->应用 确定
9.测试
import tensorflow as tf
import keras
print(tf.test.is_gpu_available())
print(tf.__version__)
print(keras.__version__)
出现
True
2.10.0
2.10.0
10.侵删