@@ -75,7 +75,7 @@ releases](https://github.com/tensorflow/compression/releases).
75
75
To install TFC via ` pip ` , run the following command:
76
76
77
77
``` bash
78
- pip install tensorflow-compression
78
+ python -m pip install tensorflow-compression
79
79
```
80
80
81
81
To test that the installation works correctly, you can run the unit tests with:
@@ -95,7 +95,7 @@ installed TensorFlow version. Run it in a cell before executing your Python
95
95
code:
96
96
97
97
```
98
- ! pip install tensorflow-compression~=$(pip show tensorflow | perl -p -0777 -e 's/.*Version: (\d+\.\d+).*/\1.0/sg')
98
+ % pip install tensorflow-compression~=$(pip show tensorflow | perl -p -0777 -e 's/.*Version: (\d+\.\d+).*/\1.0/sg')
99
99
```
100
100
101
101
Note: The binary packages of TFC are tied to TF with the same minor version
@@ -114,7 +114,7 @@ host. For instance, you can use a command line like this:
114
114
115
115
``` bash
116
116
docker run tensorflow/tensorflow:latest bash -c \
117
- " pip install tensorflow-compression &&
117
+ " python -m pip install tensorflow-compression &&
118
118
python -m tensorflow_compression.all_tests"
119
119
```
120
120
@@ -132,7 +132,7 @@ installs TensorFlow and TensorFlow Compression:
132
132
``` bash
133
133
conda create --name ENV_NAME python cudatoolkit cudnn
134
134
conda activate ENV_NAME
135
- pip install tensorflow-compression
135
+ python -m pip install tensorflow-compression
136
136
```
137
137
138
138
Depending on the requirements of the ` tensorflow ` pip package, you may need to
@@ -257,22 +257,19 @@ that TensorFlow uses.
257
257
Inside the Docker container, the following steps need to be taken:
258
258
259
259
1 . Clone the ` tensorflow/compression ` repo from GitHub.
260
- 2 . Install Python dependencies.
261
- 3 . Run ` :build_pip_pkg ` inside the cloned repo.
260
+ 2 . Run ` tools/build_pip_pkg.sh ` inside the cloned repo.
262
261
263
262
For example:
264
263
265
264
``` bash
266
- sudo docker run -i --rm -v /tmp/tensorflow_compression:/tmp/tensorflow_compression \
267
- tensorflow/build:latest-python3.10 bash -c \
268
- " git clone https://github.com/tensorflow/compression.git /tensorflow_compression &&
269
- cd /tensorflow_compression &&
270
- python -m pip install -U pip setuptools wheel &&
271
- python -m pip install -r requirements.txt &&
272
- bazel build -c opt --copt=-mavx [email protected] _manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain :build_pip_pkg &&
273
- pushd bazel-bin/build_pip_pkg.runfiles/tensorflow_compression &&
274
- python build_pip_pkg.py . /tmp/tensorflow_compression <custom-version> &&
275
- popd"
265
+ git clone https://github.com/tensorflow/compression.git /tensorflow_compression
266
+ docker run -i --rm \
267
+ -v /tmp/tensorflow_compression:/tmp/tensorflow_compression\
268
+ -v /tensorflow_compression:/tensorflow_compression \
269
+ -w /tensorflow_compression \
270
+ -e " BAZEL_OPT=--config=manylinux_2_17_x86_64" \
271
+ tensorflow/build:latest-python3.10 \
272
+ bash tools/build_pip_pkg.sh /tmp/tensorflow_compression < custom-version>
276
273
```
277
274
278
275
For Darwin, the Docker image and specifying the toolchain is not necessary. We
@@ -282,20 +279,17 @@ Python virtual environment to do this):
282
279
``` bash
283
280
git clone https://github.com/tensorflow/compression.git /tensorflow_compression
284
281
cd /tensorflow_compression
285
- python -m pip install -U pip setuptools wheel
286
- python -m pip install -r requirements.txt
287
- bazel build -c opt --copt=-mavx --macos_minimum_os=10.14 :build_pip_pkg
288
- pushd bazel-bin/build_pip_pkg.runfiles/tensorflow_compression
289
- python build_pip_pkg.py . /tmp/tensorflow_compression < custom-version> "
290
- popd
282
+ BAZEL_OPT=" --macos_minimum_os=10.14" bash \
283
+ tools/build_pip_pkg.sh \
284
+ /tmp/tensorflow_compression < custom-version>
291
285
```
292
286
293
287
In both cases, the wheel file is created inside ` /tmp/tensorflow_compression ` .
294
288
295
289
To test the created package, first install the resulting wheel file:
296
290
297
291
``` bash
298
- pip install /tmp/tensorflow_compression/tensorflow_compression-*.whl
292
+ python -m pip install /tmp/tensorflow_compression/tensorflow_compression-* .whl
299
293
```
300
294
301
295
Then run the unit tests (Do not run the tests in the workspace directory where
312
306
When done, you can uninstall the pip package again:
313
307
314
308
``` bash
315
- pip uninstall tensorflow-compression
309
+ python -m pip uninstall tensorflow-compression
316
310
```
317
311
318
312
## Evaluation
0 commit comments