Skip to content

Commit 6034a5e

Browse files
Johannes Ballécopybara-github
authored andcommitted
Adds more helpful instructions for running TFC in a Colab.
PiperOrigin-RevId: 452093094 Change-Id: I7d6eb125cd19785294dcd888e3db4325dfbef999
1 parent 8c1970e commit 6034a5e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,21 @@ similar in the last line.
8585

8686
### Colab
8787

88-
To try out TFC live in a [Colab](https://colab.research.google.com/), run the
89-
following command in a cell before executing your Python code:
88+
You can try out TFC live in a [Colab](https://colab.research.google.com/). The
89+
following command installs the latest version of TFC that is compatible with the
90+
installed TensorFlow version. Run it in a cell before executing your Python
91+
code:
9092

9193
```
92-
!pip install tensorflow-compression
94+
!pip install tensorflow-compression~=$(pip show tensorflow | perl -p -0777 -e 's/.*Version: (\\d\\.\\d).*/\\1.0/sg')
9395
```
9496

97+
Note: The binary packages of TFC are tied to TF with the same minor version
98+
(e.g., TFC 2.9.1 requires TF 2.9.x), and Colab sometimes lags behind a few days
99+
in deploying the latest version of TensorFlow. As a result, using `pip install
100+
tensorflow-compression` naively might attempt to upgrade TF, which can create
101+
problems.
102+
95103
### Docker
96104

97105
To use a Docker container (e.g. on Windows), be sure to install Docker

0 commit comments

Comments
 (0)