diff --git a/dan/ocr/document/train.py b/dan/ocr/document/train.py index 3eb15552ba975bbb294a00fd625a21ad7f1e4592..9552d042bc92a158cb29ddf9bc5314eb97d2b7f0 100644 --- a/dan/ocr/document/train.py +++ b/dan/ocr/document/train.py @@ -239,7 +239,10 @@ def get_config(): def serialize_config(config): """ - Serialize a dictionary to transform it into json and remove the credentials + Make every field of the configuration JSON-Serializable and remove sensitive information. + + - Classes are transformed using their name attribute + - Functions are casted to strings """ # Create a copy of the original config without erase it serialized_config = deepcopy(config) @@ -282,6 +285,7 @@ def serialize_config(config): "synthetic_data" in config["dataset_params"]["config"] and config["dataset_params"]["config"]["synthetic_data"] ): + # The Probability scheduler is a function and needs to be casted to string serialized_config["dataset_params"]["config"]["synthetic_data"][ "proba_scheduler_function" ] = str(