question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tensorflow-cpu is ignored when installing tensorflow-addons

See original GitHub issue

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. (https://github.com/keras-team/keras-tuner/pull/211 and https://github.com/keras-team/autokeras/pull/860)

The problem is similar to libraries that depend on Pillow and users have already pillow-SIMD installed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
gabrieldemarmiessecommented, Jan 30, 2020

I’ll let you do it if you don’t mind

1reaction
seanpmorgancommented, Jan 23, 2020

I’d be happy to review a PR which follows suite with TF-Graphics in requiring TF as an extra dependency (for easy test suite installs). We’ll also need to perform an import check during __init__ as described above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation - TensorFlow 2 Object Detection API tutorial
Install TensorFlow CPU for Python¶ · Open a new Terminal window and activate the tensorflow_cpu environment (if you have not done so already)...
Read more >
Force Anaconda to install tensorflow 1.14 - Stack Overflow
This was the missing link for me -- I had to create an env with Python=3.6; and then I could run pip install...
Read more >
TensorFlow Addons
TensorFlow Addons is a repository of contributions that conform to well-established API patterns, ... pip install tensorflow-addons.
Read more >
pip install tensorflow==1.15.2 Code Example - Code Grepper
Queries related to “pip install tensorflow==1.15.2”. pip install tensorflow · check tensorflow version · install tensorflow python · tensorflow pip · download ...
Read more >
Useful Extra Functionality for TensorFlow 2.x - Morioh
pip install tensorflow-addons[tensorflow]. Similar extras exist for the tensorflow-gpu and tensorflow-cpu packages. To use TensorFlow Addons:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found