mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-01-07 20:46:07 +00:00
The bug was introduced in commit e3145103 ("import encryption for aistudio & fix sync bn"),
where the following snippet:
```
try:
import encryption # Attempt to import the encryption module for AIStudio's encryption model
encrypted = encryption.is_encryption_needed()
except ImportError:
get_logger().warning("Skipping import of the encryption module.")
encrypted = False # Encryption is not needed if the module cannot be imported
```
caused `get_logger()` to be called too early, initializing the logger before
the training arguments were passed. As a result, the training process
skipped proper log redirection, and `train.log` was not created.
This patch replaces the warning with a simple `print()` statement,
ensuring the logger is only initialized after training args are passed.
Fixes #14846