@@ -74,6 +74,19 @@ python -m tensorflow_compression.python.all_test
74
74
Once the command finishes, you should see a message ``` OK (skipped=11) ``` or
75
75
similar in the last line.
76
76
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
+
77
90
## Usage
78
91
79
92
We 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.
125
138
They should be provided in PNG format. Training can be as simple as the
126
139
following command:
127
140
``` bash
128
- python bls2017.py -v --train_glob=" images/*.png" train
141
+ python bls2017.py --verbose --train_glob=" images/*.png" train
129
142
```
130
143
131
144
This 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
151
164
decompress images as follows. The same model checkpoint must be accessible to
152
165
both commands.
153
166
``` 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
156
169
```
157
170
158
171
## Building ` pip ` packages
@@ -174,11 +187,12 @@ Inside a Docker container from the image, the following steps need to be taken.
174
187
175
188
``` bash
176
189
sudo 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"
182
196
```
183
197
184
198
The wheel file is created inside ` /tmp/tensorflow_compression ` . Optimization
0 commit comments