Merge pull request #1837 from Channingss/dygraph

export_model support dynamic input shape
This commit is contained in:
zhoujun 2021-01-27 10:15:58 +08:00 committed by GitHub
commit 4b715cf200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -51,8 +51,11 @@ def main():
model.eval() model.eval()
save_path = '{}/inference'.format(config['Global']['save_inference_dir']) save_path = '{}/inference'.format(config['Global']['save_inference_dir'])
infer_shape = [3, 32, 100] if config['Architecture'][
'model_type'] != "det" else [3, 640, 640] infer_shape = [3, -1, -1]
if config['Architecture']['model_type'] == "rec":
infer_shape = [3, 32, -1]
model = to_static( model = to_static(
model, model,
input_spec=[ input_spec=[