@@ -75,7 +75,7 @@ releases](https://github.com/tensorflow/compression/releases).
7575To install TFC via ` pip ` , run the following command:
7676
7777``` bash
78- pip install tensorflow-compression
78+ python -m pip install tensorflow-compression
7979```
8080
8181To 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
9595code:
9696
9797```
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')
9999```
100100
101101Note: 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:
114114
115115``` bash
116116docker run tensorflow/tensorflow:latest bash -c \
117- " pip install tensorflow-compression &&
117+ " python -m pip install tensorflow-compression &&
118118 python -m tensorflow_compression.all_tests"
119119```
120120
@@ -132,7 +132,7 @@ installs TensorFlow and TensorFlow Compression:
132132``` bash
133133conda create --name ENV_NAME python cudatoolkit cudnn
134134conda activate ENV_NAME
135- pip install tensorflow-compression
135+ python -m pip install tensorflow-compression
136136```
137137
138138Depending on the requirements of the ` tensorflow ` pip package, you may need to
@@ -257,22 +257,19 @@ that TensorFlow uses.
257257Inside the Docker container, the following steps need to be taken:
258258
2592591 . 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.
262261
263262For example:
264263
265264``` 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 --crosstool_top=@ubuntu20.04-gcc9_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>
276273```
277274
278275For Darwin, the Docker image and specifying the toolchain is not necessary. We
@@ -282,20 +279,17 @@ Python virtual environment to do this):
282279``` bash
283280git clone https://github.com/tensorflow/compression.git /tensorflow_compression
284281cd /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>
291285```
292286
293287In both cases, the wheel file is created inside ` /tmp/tensorflow_compression ` .
294288
295289To test the created package, first install the resulting wheel file:
296290
297291``` bash
298- pip install /tmp/tensorflow_compression/tensorflow_compression-*.whl
292+ python -m pip install /tmp/tensorflow_compression/tensorflow_compression-* .whl
299293```
300294
301295Then run the unit tests (Do not run the tests in the workspace directory where
312306When done, you can uninstall the pip package again:
313307
314308``` bash
315- pip uninstall tensorflow-compression
309+ python -m pip uninstall tensorflow-compression
316310```
317311
318312## Evaluation
0 commit comments