Tensorflow-cpu is ignored when installing tensorflow-addons #864
Closed
Description
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): ubuntu 18.04
- TensorFlow version and how it was installed (source or binary): tensorflow-cpu 2.1.0
- TensorFlow-Addons version and how it was installed (source or binary): 0.7.0
- Python version: 3.7
- Is GPU used? (yes/no): no
Describe the bug
In an environement where tensorflow-cpu is already installed, installing tensorflow-addons should not download and install tensorflow (now being the gpu version by default).
Code to reproduce the issue
FROM python:3.7
RUN pip install tensorflow-cpu
RUN pip install tensorflow-addons
RUN pip freeze | grep tensorflow
result:
tensorflow (gpu) is still being installed (400MB download) and the installation of tensorflow is now duplicated:
tensorflow==2.1.0
tensorflow-addons==0.7.0
tensorflow-cpu==2.1.0
tensorflow-estimator==2.1.0
A solution would be to remove the tensorflow dependency in the setup.py and let people install the version of tensorflow they want. It's not a perfect solution but this is the best one we found, at least for keras-tuner and autokeras. (keras-team/keras-tuner#211 and keras-team/autokeras#860)
The problem is similar to libraries that depend on Pillow and users have already pillow-SIMD installed.