Closed xwli-chelsea closed 4 years ago
Thanks for spotting this. Nice finding!
To prevent this from happening in the future, it'd be better that we put filter_window_sizes
as 0 in the source, e.g., in method extend_hparams
. Otherwise, we'll need to exhaustively find all the end point of filter_window_sizes and fix cases like this.
Thanks for spotting this. Nice finding! To prevent this from happening in the future, it'd be better that we put
filter_window_sizes
as 0 in the source, e.g., in methodextend_hparams
. Otherwise, we'll need to exhaustively find all the end point of filter_window_sizes and fix cases like this.
Not sure why it was removed but it seems we can just keep the logic in extend_hparams. Let me add it back.
Thanks for fixing this :)
Is there any chance that we can put a test case for inference to test it?
I thought about what tests we can add. In the case of this issue, what we need is to make sure the params passed to process_text
should be the same as during training. So it's not suitable for a unit test.
But you brought a good point😊. We could probably add (maybe in another pr) some comprehensive integration tests to check if training input_fn and serving_input_fn have the same expected behaviors. I'll create an issue to track. Thanks for the comment!
Thanks for fixing this :)
Is there any chance that we can put a test case for inference to test it?
I thought about what tests we can add. In the case of this issue, what we need is to make sure the params passed to process_text
should be the same as during training. So it's not suitable for a unit test.
But you brought a good point😊. We could probably add (maybe in another pr) some comprehensive integration tests to check if training input_fn and serving_input_fn have the same expected behaviors. I'll create an issue to track. Thanks for the comment!
Description
In https://github.com/linkedin/detext/pull/28 the
filter_window_sizes
override was removed. The param passing toprocess_text
is inconsistent for none-CNN models:process_text
: https://github.com/linkedin/detext/blob/master/src/detext/train/data_fn.py#L151This inconsistency causes problems with the inference savedmodel models.
This pr fixes the logic for
filter_window_sizes
in theserving_input_fn
.Fixes # (issue) 474: internal issue reported for inference model
Type of change
Please delete options that are not relevant.
List all changes
Update logic in train_helper, where the helper functions are used in
serving_input_fn
. This sets thefilter_window_sizes
for cnn only. Code search on this logicTesting
pytest local training run, and tested inference model.
Test Configuration:
Checklist