stop_gradient=True for input spec
@@ -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))
