This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
cs:vision:object_detection:start [2018/03/31 19:46] James Irwin [Getting a Model] |
cs:vision:object_detection:start [2018/03/31 20:01] (current) James Irwin [Exporting a trained model for inference] |
||
|---|---|---|---|
| Line 100: | Line 100: | ||
| ===== Start Training ===== | ===== Start Training ===== | ||
| - | The following command assume your current working directory is the root of the workspace you created earlier. To start training, run: | + | The following commands assume your current working directory is the root of the workspace you created earlier. |
| + | |||
| + | To start training, run: | ||
| python ~/.local/tensorflow_object_detection_api/research/object_detection/train.py \ | python ~/.local/tensorflow_object_detection_api/research/object_detection/train.py \ | ||
| --logtostderr \ | --logtostderr \ | ||
| --pipeline_config_path=<model config file> \ | --pipeline_config_path=<model config file> \ | ||
| - | --train_dir= | + | --train_dir=output/train |
| + | |||
| + | To evaluate the performance of the network, run: | ||
| + | python ~/.local/tensorflow_object_detection_api/research/object_detection/eval.py \ | ||
| + | --logtostderr \ | ||
| + | --pipeline_config_path=<model config file> \ | ||
| + | --checkpoint_dir=output/train/ \ | ||
| + | --eval_dir=output/eval/ | ||
| + | The eval.py script will notice every time the train.py script saves a new checkpoint, and evaluate its performance on the test dataset. | ||
| + | |||
| + | To visualize the training process, start up tensorboard: | ||
| + | tensorboard --logdir=outputs | ||
| + | Tensorboard is a little web server, you can access it at localhost:6006 in your browser. | ||
| ===== Exporting a trained model for inference ===== | ===== Exporting a trained model for inference ===== | ||
| To export checkpoint trained data for ''%%robosub_object_detection%%'' format you need to follow [[https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/exporting_models.md|these]] instructions. Or run this: | To export checkpoint trained data for ''%%robosub_object_detection%%'' format you need to follow [[https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/exporting_models.md|these]] instructions. Or run this: | ||
| Line 113: | Line 127: | ||
| --output_directory output_inference_graph.pb | --output_directory output_inference_graph.pb | ||
| + | At this point, you should upload the label_map.pbtext and frozen_inference_graph.pb files into a uniquely named folder inside [[http://robosub.eecs.wsu.edu/data/vision/trained_models/]], so its easy for other members to access the models. | ||