Commit eb97cf1e authored by Yuxin Wu's avatar Yuxin Wu

update docs

parent 7b9d9b8c
......@@ -63,7 +63,7 @@ The example in [examples/basics/export-model.py](../examples/basics/export-model
### Exporter
In addition to the standard checkpoint format tensorpack saved for you during training,
you can also save your models into other formats so it may be more friendly for inference.
you can also save your models into other formats after training, so it may be more friendly for inference.
1. Export to `SavedModel` format for TensorFlow Serving:
......@@ -133,7 +133,7 @@ with TowerContext('', is_training=False):
```
```eval_rst
.. note:: **Do not use metagraph for inference!**.
.. note:: **Do not use metagraph for inference!**
Metagraph is the wrong abstraction for a "model".
It stores the entire graph which contains not only the mathematical model, but also all the
......@@ -155,7 +155,7 @@ with TowerContext('', is_training=False):
### Step 2: load the checkpoint
You can just use `tf.train.Saver` for all the work.
Alternatively, use tensorpack's `SaverRestore(path).init(tf.get_default_session())`
Alternatively, use tensorpack's `get_model_loader(path).init(tf.get_default_session())`
Now, you've already built a graph for inference, and the checkpoint is loaded.
You may now:
......
......@@ -62,8 +62,10 @@ The function `launch_train_with_config(config, trainer)`
uses the raw trainer interface and is almost equivalent to the following two lines of code:
```python
trainer.setup_graph(
my_model.get_inputs_desc(), my_input_source, # or QueueInput(my_dataflow)
my_model.build_graph, my_model.get_optimizer)
my_model.get_inputs_desc(),
my_input_source, # or QueueInput(my_dataflow)
my_model.build_graph,
my_model.get_optimizer)
trainer.train_with_defaults(
callbacks=config.callbacks,
monitors=config.monitors,
......@@ -76,7 +78,8 @@ trainer.train_with_defaults(
```
If you need more control (e.g., if you want to construct the callbacks after
setting up the graph), you can write the above two lines by yourself instead.
You don't need to construct a `TrainConfig` any more in that case.
The function `launch_train_with_config` exists mainly for historical reasons.
### Keras Interface
......
......@@ -67,9 +67,34 @@ Speed:
Possible Future Enhancements:
1. Define a better interface to load custom dataset.
1. Define a better interface to load different datasets.
1. Support batch>1 per GPU.
1. Support batch>1 per GPU. Batching with inconsistent shapes is
non-trivial to implement in TensorFlow.
1. Use dedicated ops to improve speed. (e.g. a TF implementation of ROIAlign op
can be found in [light-head RCNN](https://github.com/zengarden/light_head_rcnn/tree/master/lib/lib_kernel))
### TensorFlow version notes
TensorFlow ≥ 1.6 supports most common features in this R-CNN implementation.
However, each version of TensorFlow has bugs that I either reported or fixed,
and this implementation touches many of those bugs.
Therefore, not every version of TF ≥ 1.6 supports every feature in this implementation.
This implementation contains workaround for some of those TF bugs.
However, note that the workaround needs to check your TF version by `tf.VERSION`
and may not detect bugs properly if your TF version is not an official release
(e.g., if you use a nighly build).
1. TF < 1.6: Nothing works due to lack of support for empty tensors
([PR](https://github.com/tensorflow/tensorflow/pull/15264))
and `FrozenBN` training
([PR](https://github.com/tensorflow/tensorflow/pull/12580)).
1. TF < 1.10: `SyncBN` with NCCL will fail ([PR](https://github.com/tensorflow/tensorflow/pull/20360)).
1. TF 1.11 & 1.12: multithread inference will fail ([issue](https://github.com/tensorflow/tensorflow/issues/22750)).
Latest tensorpack will apply a workaround.
1. TF > 1.12: MKL inference will fail ([issue](https://github.com/tensorflow/tensorflow/issues/24650)).
1. TF > 1.12: Horovod training will fail ([issue](https://github.com/tensorflow/tensorflow/issues/25946)).
Latest tensorpack will apply a workaround.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment