View source on GitHub |
Count the number of parameters if model is possible.
tfm.core.train_utils.try_count_params(
model: Union[tf.Module, tf.keras.Model], trainable_only: bool = False
)
Args | |
---|---|
model
|
Try to count the number of params in this model. |
trainable_only
|
Whether to calculate trainable params only. This flag is
not used when the model has count_params attribute.
|
Returns | |
---|---|
The number of parameters or None. |