Skip to content

Commit 77a340f

Browse files
Johannes Ballécopybara-github
authored andcommitted
Prepares for 2.1 release.
- Removes workarounds for TF 2.4, since they are not enough to make TFC fully functional. Instead, we depend on TF nightly builds. - Removes dynamic check for TF version, and moves TF into `requirements.txt`. This is possible since in TF 2, the `-gpu` pip packages have been discontinued. - Simplifies/adjusts installation instructions accordingly. PiperOrigin-RevId: 362235658 Change-Id: I939d07387cdbe244493b37e659a9bbfe21ee06da
1 parent 6158a0e commit 77a340f

29 files changed

+146
-138
lines changed

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,31 @@ for a complete description of the classes and functions this package implements.
3636
## Installation
3737

3838
***Note: Precompiled packages are currently only provided for Linux and
39-
Darwin/Mac OS. To use these packages on Windows, consider using a [TensorFlow
40-
Docker image](https://www.tensorflow.org/install/docker) and installing
41-
TensorFlow Compression using pip inside the Docker container.***
39+
Darwin/Mac OS and Python 3.6-3.8. To use these packages on Windows, consider
40+
using a [TensorFlow Docker image](https://www.tensorflow.org/install/docker) and
41+
installing TensorFlow Compression using pip inside the Docker container.***
4242

4343
Set up an environment in which you can install precompiled binary Python
4444
packages using the `pip` command. Refer to the
4545
[TensorFlow installation instructions](https://www.tensorflow.org/install/pip)
4646
for more information on how to set up such a Python environment.
4747

48-
The current version of TFC (v2.0) requires TensorFlow v2.4. For versions
49-
compatible with TensorFlow v1, see our [previous
48+
The current version of TensorFlow Compression requires TensorFlow 2. For
49+
versions compatible with TensorFlow 1, see our [previous
5050
releases](https://github.com/tensorflow/compression/releases).
51+
***Note: Because TFC currently relies on features and fixes designated for
52+
TF 2.5, the pip package currently depends on tf-nightly packages. Once TF 2.5 is
53+
released (likely in April 2021), we will resume depending on the stable version
54+
of TF.***
5155

5256
### pip
5357

54-
To install TF and TFC via `pip`, run the following command:
58+
To install TFC via `pip`, run the following command:
5559

5660
```bash
57-
pip install tensorflow-gpu==2.4.* tensorflow-compression==2.0
61+
pip install tensorflow-compression
5862
```
5963

60-
If you don't need GPU support, you can drop the `-gpu` part.
61-
6264
To test that the installation works correctly, you can run the unit tests with:
6365

6466
```bash
@@ -77,8 +79,8 @@ and then run the `pip install` command inside the Docker container, not on the
7779
host. For instance, you can use a command line like this:
7880

7981
```bash
80-
docker run tensorflow/tensorflow:2.4.1 bash -c \
81-
"pip install tensorflow-compression==2.0 &&
82+
docker run tensorflow/tensorflow:nightly bash -c \
83+
"pip install tensorflow-compression &&
8284
python -m tensorflow_compression.all_tests"
8385
```
8486

@@ -91,13 +93,12 @@ It seems that [Anaconda](https://www.anaconda.com/distribution/) ships its own
9193
binary version of TensorFlow which is incompatible with our pip package. To
9294
solve this, always install TensorFlow via `pip` rather than `conda`. For
9395
example, this creates an Anaconda environment with Python 3.6 and CUDA
94-
libraries, and then installs TensorFlow and TensorFlow Compression with GPU
95-
support:
96+
libraries, and then installs TensorFlow and TensorFlow Compression:
9697

9798
```bash
98-
conda create --name ENV_NAME python=3.6 cudatoolkit=10.0 cudnn
99+
conda create --name ENV_NAME python=3.8 cudatoolkit=10.0 cudnn
99100
conda activate ENV_NAME
100-
pip install tensorflow-gpu==2.4.* tensorflow-compression==2.0
101+
pip install tensorflow-compression
101102
```
102103

103104
## Usage

docs/api_docs/python/tfc/DeepFactorized.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ May be partially defined or unknown.
190190
</td>
191191
</tr><tr>
192192
<td>
193+
`experimental_is_sharded`
194+
</td>
195+
<td>
196+
`True` for distributions which parallel-sum `log_prob` across devices.
197+
</td>
198+
</tr><tr>
199+
<td>
193200
`init_scale`
194201
</td>
195202
<td>

docs/api_docs/python/tfc/GDNParameter.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: Nonnegative parameterization as needed for GDN parameters.
1717

1818
<table class="tfo-notebook-buttons tfo-api nocontent" align="left">
1919
<td>
20-
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L149-L229">
20+
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L147-L226">
2121
<img src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" />
2222
View source on GitHub
2323
</a>
@@ -220,7 +220,7 @@ of calling this method if you don't expect the return value to change.
220220

221221
<h3 id="get_config"><code>get_config</code></h3>
222222

223-
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L220-L229">View source</a>
223+
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L217-L226">View source</a>
224224

225225
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
226226
<code>get_config() -> Dict[str, Any]
@@ -231,7 +231,7 @@ Returns the configuration of the `Parameter`.
231231

232232
<h3 id="get_weights"><code>get_weights</code></h3>
233233

234-
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L49-L50">View source</a>
234+
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L48-L49">View source</a>
235235

236236
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
237237
<code>get_weights()
@@ -242,7 +242,7 @@ Returns the configuration of the `Parameter`.
242242

243243
<h3 id="set_weights"><code>set_weights</code></h3>
244244

245-
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L52-L57">View source</a>
245+
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L51-L56">View source</a>
246246

247247
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
248248
<code>set_weights(
@@ -318,7 +318,7 @@ The original method wrapped such that it enters the module's name scope.
318318

319319
<h3 id="__call__"><code>__call__</code></h3>
320320

321-
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L207-L210">View source</a>
321+
<a target="_blank" href="https://github.com/tensorflow/compression/tree/master/tensorflow_compression/python/layers/parameters.py#L203-L207">View source</a>
322322

323323
<pre class="devsite-click-to-copy prettyprint lang-py tfo-signature-link">
324324
<code>__call__() -> tf.Tensor

docs/api_docs/python/tfc/MonotonicAdapter.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ May be partially defined or unknown.
153153
</td>
154154
</tr><tr>
155155
<td>
156+
`experimental_is_sharded`
157+
</td>
158+
<td>
159+
`True` for distributions which parallel-sum `log_prob` across devices.
160+
</td>
161+
</tr><tr>
162+
<td>
156163
`name`
157164
</td>
158165
<td>

docs/api_docs/python/tfc/NoisyDeepFactorized.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ May be partially defined or unknown.
148148
</td>
149149
</tr><tr>
150150
<td>
151+
`experimental_is_sharded`
152+
</td>
153+
<td>
154+
`True` for distributions which parallel-sum `log_prob` across devices.
155+
</td>
156+
</tr><tr>
157+
<td>
151158
`name`
152159
</td>
153160
<td>

docs/api_docs/python/tfc/NoisyLogistic.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ May be partially defined or unknown.
148148
</td>
149149
</tr><tr>
150150
<td>
151+
`experimental_is_sharded`
152+
</td>
153+
<td>
154+
`True` for distributions which parallel-sum `log_prob` across devices.
155+
</td>
156+
</tr><tr>
157+
<td>
151158
`name`
152159
</td>
153160
<td>

docs/api_docs/python/tfc/NoisyLogisticMixture.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@ May be partially defined or unknown.
246246
</td>
247247
</tr><tr>
248248
<td>
249+
`experimental_is_sharded`
250+
</td>
251+
<td>
252+
`True` for distributions which parallel-sum `log_prob` across devices.
253+
</td>
254+
</tr><tr>
255+
<td>
249256
`mixture_distribution`
250257
</td>
251258
<td>

docs/api_docs/python/tfc/NoisyMixtureSameFamily.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ May be partially defined or unknown.
245245
</td>
246246
</tr><tr>
247247
<td>
248+
`experimental_is_sharded`
249+
</td>
250+
<td>
251+
`True` for distributions which parallel-sum `log_prob` across devices.
252+
</td>
253+
</tr><tr>
254+
<td>
248255
`mixture_distribution`
249256
</td>
250257
<td>

docs/api_docs/python/tfc/NoisyNormal.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ May be partially defined or unknown.
148148
</td>
149149
</tr><tr>
150150
<td>
151+
`experimental_is_sharded`
152+
</td>
153+
<td>
154+
`True` for distributions which parallel-sum `log_prob` across devices.
155+
</td>
156+
</tr><tr>
157+
<td>
151158
`name`
152159
</td>
153160
<td>

docs/api_docs/python/tfc/NoisyNormalMixture.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@ May be partially defined or unknown.
246246
</td>
247247
</tr><tr>
248248
<td>
249+
`experimental_is_sharded`
250+
</td>
251+
<td>
252+
`True` for distributions which parallel-sum `log_prob` across devices.
253+
</td>
254+
</tr><tr>
255+
<td>
249256
`mixture_distribution`
250257
</td>
251258
<td>

0 commit comments

Comments
 (0)