问题:想装tfx,但是提示不支持python3.9。

解决方案:新建一个环境tfx专门用来运行流水线,这个环境安装python3.8。
1.查看自己的python版本(jupyter notebook):
import sys
sys.version #查看python版本

2.新建一个名为tfx的环境(Anaconda Prompt)
首先查看当前已有环境:
conda env list

创建一个名为【tfx】的环境:
conda create --name tfx python==3.8


输入y?
创建完毕


代码:
#激活环境
conda activate tfx
#退出环境
conda deactivate
#删除环境
conda remove -n tfx --all
#查看环境
conda env list
3.Anaconda选择新环境

?需要安装jupyter

4.安装tfx?
进入新环境,python版本已经变成3.8了

?安装tensorflow和tfx:
(安装tfx的时候报错提示pywinpty版本太高,于是先装一个低版本的pywinpty)
pip install tensorflow
pip install pywinpty==1.1.6
pip install tfx==1.7.0
查看版本
import tensorflow as tf
print('TensorFlow version: {}'.format(tf.__version__))
from tfx import v1 as tfx
print('TFX version: {}'.format(tfx.__version__))

https://tensorflow.google.cn/tfx/guide
|