Skip to content

Commit a18d360

Browse files
gtodericicopybara-github
authored andcommitted
Update documentation to reflect the fact that "train" is a module, and
when executed python needs the -m flag. PiperOrigin-RevId: 318536763 Change-Id: I630d6bbe50e4205af6eafc25e6e05acc92537273
1 parent 52af1e0 commit a18d360

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

models/hific/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ convolution algorithm. This is probably because cuDNN".
7878

7979
In this case, try setting `TF_FORCE_GPU_ALLOW_GROWTH=true`, e.g.:
8080
```bash
81-
TF_FORCE_GPU_ALLOW_GROWTH=true python train.py ...
81+
TF_FORCE_GPU_ALLOW_GROWTH=true python -m hific.train ...
8282
```
8383

8484
#### Note on Memory Consumption
@@ -107,16 +107,22 @@ needs to be adapted to a bigger dataset to obtain good results
107107
For the paper, we initialize our GAN models from a MSE+LPIPS checkpoint. To
108108
replicate this, first train a model for MSE + LPIPS only, and then use that as a
109109
starting point:
110+
110111
```bash
112+
# Need to be in the models directory such that hific is a subdirectory.
113+
cd models
114+
111115
# First train a model for MSE+LPIPS:
112-
python train.py --config mselpips --ckpt_dir ckpts/mse_lpips --num_steps 1M
113-
--tfds_dataset_name coco2014
116+
python -m hific.train --config mselpips --ckpt_dir ckpts/mse_lpips \
117+
--num_steps 1M --tfds_dataset_name coco2014
114118

115119
# Once that finishes, train a GAN model:
116-
python train.py --config hific --ckpt_dir ckpts/hific \
117-
--init_autoencoder_from_ckpt_dir ckpts/mselpips --num_steps 1M
120+
python -m hific.train --config hific --ckpt_dir ckpts/hific \
121+
--init_autoencoder_from_ckpt_dir ckpts/mselpips \
122+
--num_steps 1M \
118123
--tfds_dataset_name coco2014
119124
```
125+
120126
Additional helpful arguments are `--tfds_dataset_name`,
121127
and `--tfds_download_dir`, see `--help` for more.
122128

@@ -128,7 +134,7 @@ To test a trained model, use `evaluate.py` (it also supports the `--tfds_*`
128134
flags):
129135

130136
```bash
131-
python evaluate.py --config hific --ckpt_dir ckpts/hific --out_dir out/ \
137+
python -m hific.evaluate --config hific --ckpt_dir ckpts/hific --out_dir out/ \
132138
--tfds_dataset_name coco2014
133139
```
134140

0 commit comments

Comments
 (0)