diff --git a/ppcls/arch/__init__.py b/ppcls/arch/__init__.py index ecc1af793a4c6ec0eeba3d0a567da0b90bb1c485..3a0738e1ec8e31bfd9efe05c65e9565b26bf5200 100644 --- a/ppcls/arch/__init__.py +++ b/ppcls/arch/__init__.py @@ -64,6 +64,7 @@ def apply_to_static(config, model): specs = None if 'image_shape' in config['Global']: specs = [InputSpec([None] + config['Global']['image_shape'])] + specs[0].stop_gradient = True model = to_static(model, input_spec=specs) logger.info("Successfully to apply @to_static with specs: {}".format( specs))