python虚拟环境配置
conda create env -n name python=*.*
修改虚拟环境的名称
conda create -n env-newname --clone env-oldname # 将老的环境复制到新环境中
conda remove -n env-oldname --all # 删除老的环境
conda install -r requirements.txt # 安装新环境内需要包含的包
conda env list #查看已经安装的包
tensorflow 报错:因为tf的版本问题,所以需要改成下面的样式
# module 'tensorflow' has no attribute 'app
# 版本不对,导入包的时候改成:
import tensorflow._api.v2.compat.v1 as tf
tensorflow 遇到: AttributeError: module ‘tensorflow‘ has no attribute ‘flags‘
# flags = tf.app.flags
flags= tf.compat.v1.flags
FLAGS = flags.FLAGS
tensorflow 遇到: module ‘tensorflow’ has no attribute ‘set_random_seed’
# tf.set_random_seed(seed)
tf.random.set_seed(1)