From bf9b9331844def37565e09fcde638eedcfee3f0f Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 27 Jun 2024 10:35:02 +0800 Subject: [PATCH] update comfig.py --- npu_mnist_example/config.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/npu_mnist_example/config.py b/npu_mnist_example/config.py index a419659..3a90c7e 100644 --- a/npu_mnist_example/config.py +++ b/npu_mnist_example/config.py @@ -16,19 +16,21 @@ network config setting, will be used in train.py """ import os -os.system('pip install easydict') -from easydict import EasyDict as edict +class Config: + def __init__(self, **entries): + self.__dict__.update(entries) -mnist_cfg = edict({ - 'num_classes': 10, - 'lr': 0.01, - 'momentum': 0.9, - 'epoch_size': 10, - 'batch_size': 32, - 'buffer_size': 1000, - 'image_height': 32, - 'image_width': 32, - 'save_checkpoint_steps': 1875, - 'keep_checkpoint_max': 150, - 'air_name': "lenet", -}) +# 定义配置信息 +mnist_cfg = Config( + num_classes=10, + lr=0.01, + momentum=0.9, + epoch_size=10, + batch_size=32, + buffer_size=1000, + image_height=32, + image_width=32, + save_checkpoint_steps=1875, + keep_checkpoint_max=150, + air_name="lenet" +)