How to save MobileNet-SSD model? with detection mAP evaluator?
Created by: wojtuss
When training a MobileNet-SSD model, the train.py
script allows for saving persistables using
fluid.io.save_persistables(exe, model_path, main_program=main_prog)
But how can we save the whole model? In order to save the whole model for inference using:
fluid.io.save_inference_model("abc", feed_dict, [target], exe)
we need to provide feed_dict
and target
.
- What should the
feed_dict
be? Usually, thefeed
argument ofexe.run()
method suggest the answer, but in MobileNet-SSD, thefeed
is not defined. Thepy_reader
is used there. - What should the
target
be? Several attempts to put anything into target failed with message
Traceback (most recent call last):
...
File "/home/wojtuss/repos/PaddlePaddle/Paddle/build/python/paddle/fluid/io.py", line 654, in save_inference_model
main_program = main_program._prune(targets=target_vars)
File "/home/wojtuss/repos/PaddlePaddle/Paddle/build/python/paddle/fluid/framework.py", line 1739, in _prune
"The target variable must have an "
ValueError: The target variable must have an associated operator that generates it.
- Is it possible to save the model with the
DetectionMAP
evaluator?