1. 安装TensorFlow2.x
1.1 conda创建环境
conda create -n tensorflow2 python=3.9
conda activate tensorflow2
# 删除环境
conda remove -n tensorflow2 --all
1.2 安装package
# 前提:安装好CUDA11.2和cuDNN8.1
pip install tensorflow-gpu==2.6
# 安装常用包
conda install tqdm
conda install numpy
conda install pandas
conda install matplotlib
conda install scikit-learn
pip install swifter
1.3 判断GPU是否可用
import tensorflow as tf
print(tf.config.list_physical_devices('GPU'))
2. 安装DeepCTR环境
2.1 conda创建环境
Now deepctr is available for python 2.7and 3.5, 3.6, 3.7.
conda create -n deepctr python=3.7
conda activate deepctr
# 删除环境
conda remove -n deepctr --all
1.2 安装package
# 前提:安装好CUDA11.2和cuDNN8.1
pip install deepctr[gpu]
# 若已安装了TensorFlow,则使用命令
pip install -U deepctr
# 安装常用包
conda install tqdm
conda install numpy
conda install pandas
conda install matplotlib
conda install scikit-learn
pip install swifter
|