-
Notifications
You must be signed in to change notification settings - Fork 45.4k
object_detection exporter updates #2053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Bug: We use two different Saver objects during training, one to initialize from a checkpoint and another to save and restore from checkpoints during training. Both these Savers were bound to same variable name causing init_fn function to use the latter instead of the former when called.
This change is required to enable object detection export and inference with dynamic batch size.
A few change to prepare for batch inference: * Modify the return type of batch non max suppression to be tuple of tensors so it can be reused for both stages of faster rcnn without any confusion in the semantics implied the the keys used to represent the tensors. * Allow dynamic number of anchors (boxes) in addition to dynamic batch size. * Remove a redundant dynamic batch size test.
* Adds a util function to compute a mix of dynamic and static shapes preferring static when available. * Uses batch_multiclass_non_max_suppression function in postprocess_rpn instead of looping over static batch shape and performing multiclass_non_max_suppression. * Adds a new helper function _unpad_proposals_and_sample_boxclassifier_batch to sample from a batch of tensors possibly containing paddings. * Tests batch inference with various configurations of static shape via unittests.
* Creates a new batch_decode method in SSD Meta architecture that can handle dynamic batch size. * use combined_shapes in _get_feature_maps_spatial_dims method to handle dynamic batch image_size. * Add dynamic batch size tests to check preprocess, predict and postprocess methods in SSD Meta architecture.
| TODO: revisit whether it's possible to force the `Repeat` namescope as | ||
| created in `_extract_box_classifier_features` to start counting at 2 (e.g. | ||
| `Repeat_2`) so that the default restore_fn can be used. | ||
| TODO(jonathanhuang,rathodv): revisit whether it's possible to force the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you purge the names ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good Derek. Just one nit. Thanks for merging this humungous set of changes !
|
PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to Me. Please run affected tests and a few steps of train and eval before merging. Thanks!
|
@derekjchow you rock! |
No description provided.