diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 676872ba39c5d41bf4d69e41b274202e3886c7fc..662638103f988d00ef8e8ac1718cc08e6105158b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,12 +24,6 @@ files: \.(md|yml)$ - id: check-case-conflict -- repo: https://github.com/asottile/reorder_python_imports - rev: v1.9.0 - hooks: - - id: reorder-python-imports - args: [--py3-plus] - - repo: https://github.com/Lucas-C/pre-commit-hooks sha: v1.0.1 hooks: diff --git a/ppcls/utils/logger.py b/ppcls/utils/logger.py index 20575c32eea2ce17d282ed5ff5a65e22d0b0ac5d..b66818fdc55ae7eece0b414da0d170f13eb58ab1 100644 --- a/ppcls/utils/logger.py +++ b/ppcls/utils/logger.py @@ -72,10 +72,23 @@ def error(fmt, *args): def advertisement(): + """ + Show the advertising message like the following: + + =========================================================== + == PaddleClas is powered by PaddlePaddle ! == + =========================================================== + == == + == For more info please go to the following website. == + == == + == https://github.com/PaddlePaddle/PaddleClas == + =========================================================== + + """ copyright = "PaddleClas is powered by PaddlePaddle !" info = "For more info please go to the following website." website = "https://github.com/PaddlePaddle/PaddleClas" - AD_LEN = 55 + AD_LEN = 6 + len(max([copyright, info, website], key=len)) _logger.info("\n{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n{6}\n{7}\n".format( "=" * (AD_LEN + 4), diff --git a/tools/train.py b/tools/train.py index b4e3c788e655e6ef4d60a0911eb84f7d59eb6506..1fc1465e8dbc2036122c4bb8f63880ee9b6cf8d7 100644 --- a/tools/train.py +++ b/tools/train.py @@ -11,19 +11,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + import argparse import os import paddle.fluid as fluid -import program from paddle.fluid.incubate.fleet.base import role_maker from paddle.fluid.incubate.fleet.collective import fleet from ppcls.data import Reader from ppcls.utils import logger from ppcls.utils.config import get_config -from ppcls.utils.save_load import init_model -from ppcls.utils.save_load import save_model +from ppcls.utils.save_load import init_model, save_model +import program def parse_args():