Closed mys007 closed 4 years ago
Currently, the codebase does not allow to pass arguments to model calls, e.g.
https://github.com/keisen/tf-keras-vis/blob/fdfb61b325fe6f49e7297fc38f37e9f02bfd918f/tf_keras_vis/gradcam.py#L58
This means one cannot influence whether a model is called in inference or training mode, as e.g. data augmentation layers are on by default (https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py#L396) and global setting of learning phase is deprecated (https://www.tensorflow.org/api_docs/python/tf/keras/backend/set_learning_phase). I suggest the training mode be passed as a parameter of e.g. Gradcam.call.
Thank you for your reporting! I will address it immediately.
Awesome, really great maintenance! Thanks.
You're welcome! BTW, if you would like, please click the Github Stars of this repository.
Currently, the codebase does not allow to pass arguments to model calls, e.g.
https://github.com/keisen/tf-keras-vis/blob/fdfb61b325fe6f49e7297fc38f37e9f02bfd918f/tf_keras_vis/gradcam.py#L58
This means one cannot influence whether a model is called in inference or training mode, as e.g. data augmentation layers are on by default (https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py#L396) and global setting of learning phase is deprecated (https://www.tensorflow.org/api_docs/python/tf/keras/backend/set_learning_phase). I suggest the training mode be passed as a parameter of e.g. Gradcam.call.