Install TFX locally (Ubuntu 20)

Hello,

I try to install TFX locally in order to run the same command as in the notebooks on my local machine.

So far using virtualenv and anaconda I didn’t have been successful: there is always missing dependencies.

Is somebody known how to install TFX=0.24.0
and Tensorflow=2.4.1 with virtualenv or anaconda under Ubuntu 20?

hi @chenevert , welcome to Discourse!

I am using TensorFlow 2.5.0, so have not tried to install TFX=0.24.0, but have been able to install TFX=1.0.0-rc1 using Docker image of Ubuntu 20.04.
Here is the docker file I used which installed following version

tensorflow 2.5.0
tensorflow-gpu 2.5.0

I installed TFX on that with the following command:

!pip install tfx==1.0.0-rc1

After installing TFX, following TensorFlow packages are installed:
(excluded tensorflow packages above)

!pip list | grep tensorflow

tensorflow-addons 0.13.0
tensorflow-data-validation 1.0.0
tensorflow-datasets 4.3.0
tensorflow-estimator 2.5.0
tensorflow-hub 0.9.0
tensorflow-metadata 1.0.0
tensorflow-model-analysis 0.31.0
tensorflow-serving-api 2.5.1
tensorflow-text 2.5.0
tensorflow-transform 1.0.0

With this setting I can run the lab for Course 3 Week 1 TFX Tuner and Trainer.

Hope it helps,
Cuong

Hi @tranvinhcuong ,

Thanks for the help.

I ended up using tensorflow/tfx image on docker hub.

My Dockerfile

FROM tensorflow/tfx:0.29.0
RUN pip install tensorflow_addons==0.12.1
WORKDIR /workdir
EXPOSE 8888
ENTRYPOINT ["jupyter", "notebook"]
CMD ["--allow-root", "--port=8888", "--ip=0.0.0.0"]

with build

docker image build  -t cs-mlops .

and run

docker run --gpus all -it -p "8888:8888" -v $PWD:/workdir --name cs-mlops-gpu cs-mlops

With this and a minor modification on the notebook (train<-Split-train) I was able to run the Weather example of Course2 - Week4 (C2_W4_Lab_1_WeatherData.ipynb).

1 Like