@@ -74,6 +74,19 @@ python -m tensorflow_compression.python.all_test
7474Once the command finishes, you should see a message ``` OK (skipped=11) ``` or
7575similar in the last line.
7676
77+ To use a Docker container (e.g. on Windows), be sure to install Docker
78+ (e.g., [ Docker Desktop] ( https://www.docker.com/products/docker-desktop ) ,
79+ use a [ TensorFlow Docker image] ( https://www.tensorflow.org/install/docker ) ,
80+ and then run the ` pip install ` command inside the Docker container, not on the
81+ host. For instance, you can use a command line like this:
82+ ``` bash
83+ docker run tensorflow/tensorflow:latest-py3 bash -c \
84+ " pip install tensorflow-compression &&
85+ python -m tensorflow_compression.python.all_test"
86+ ```
87+ This will fetch the latest TensorFlow Docker image, install the ` pip ` package
88+ and then run the unit tests to confirm that it works.
89+
7790## Usage
7891
7992We recommend importing the library from your Python code as follows:
@@ -125,7 +138,7 @@ To train the model, you need to supply it with a dataset of RGB training images.
125138They should be provided in PNG format. Training can be as simple as the
126139following command:
127140``` bash
128- python bls2017.py -v --train_glob=" images/*.png" train
141+ python bls2017.py --verbose --train_glob=" images/*.png" train
129142```
130143
131144This will use the default settings. The most important parameter is ` --lambda ` ,
@@ -151,8 +164,8 @@ When training has finished, the Python script can be used to compress and
151164decompress images as follows. The same model checkpoint must be accessible to
152165both commands.
153166``` bash
154- python bls2017.py [options] compress original.png compressed.bin
155- python bls2017.py [options] decompress compressed.bin reconstruction.png
167+ python bls2017.py [options] compress original.png compressed.tfci
168+ python bls2017.py [options] decompress compressed.tfci reconstruction.png
156169```
157170
158171## Building ` pip ` packages
@@ -174,11 +187,12 @@ Inside a Docker container from the image, the following steps need to be taken.
174187
175188``` bash
176189sudo docker run -v /tmp/tensorflow_compression:/tmp/tensorflow_compression \
177- tensorflow/tensorflow:nightly-custom-op \
178- bash -c " pip install tensorflow &&
179- git clone https://github.com/tensorflow/compression.git
180- /tensorflow_compression && cd /tensorflow_compression &&
181- bazel run -c opt --copt=-mavx :build_pip_pkg"
190+ tensorflow/tensorflow:nightly-custom-op bash -c \
191+ " pip install tensorflow &&
192+ git clone https://github.com/tensorflow/compression.git
193+ /tensorflow_compression &&
194+ cd /tensorflow_compression &&
195+ bazel run -c opt --copt=-mavx :build_pip_pkg"
182196```
183197
184198The wheel file is created inside ` /tmp/tensorflow_compression ` . Optimization
0 commit comments