MiniBullLab / easy_ai

3 stars 1 forks source link

训练denet报错 #86

Closed foww-0001 closed 3 years ago

foww-0001 commented 3 years ago

在easy_tools运行denet报错,运行命令如下:

python easy_tools/easy_ai.py -t DeNET -g 0 -i /home/wfw/workspace/EDGE/SiNGRAYNET_V0.4_Samples_20210514/DeNet_Sample/DeNet-fruit_training_data/ImageSets/train.txt -v /home/wfw/workspace/EDGE/SiNGRAYNET_V0.4_Samples_20210514/DeNet_Sample/DeNet-fruit_training_data/ImageSets/val.txt

报错如下:

Traceback (most recent call last):
  File "easy_tools/easy_ai.py", line 69, in <module>
    train_main()
  File "easy_tools/easy_ai.py", line 60, in train_main
    train_process.det2d_model_train(dir_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easy_tools/easyai_train.py", line 66, in det2d_model_train
    train_task.train("denet", self.gpu_id, self.config_path, pretrain_model_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/train_task.py", line 29, in train
    task = build_from_cfg(task_args, REGISTERED_TRAIN_TASK)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/utility/registry.py", line 107, in build_from_cfg
    return obj_cls(**args)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/det2d/detect2d_train.py", line 21, in __init__
    self.detect_test = Detection2dTest(model_name, gpu_id, self.train_task_config)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/det2d/detect2d_test.py", line 20, in __init__
    self.inference = Detection2d(model_name, gpu_id, config_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/det2d/detect2d.py", line 23, in __init__
    self.task_config.post_prcoess)
AttributeError: 'Detect2dConfig' object has no attribute 'post_prcoess'
foww-0001 commented 3 years ago

测试后问题解决。

foww-0001 commented 3 years ago

拉取最新分支,运行同样的命令进行denet训练:

Traceback (most recent call last):
  File "easy_tools/easy_ai.py", line 69, in <module>
    train_main()
  File "easy_tools/easy_ai.py", line 60, in train_main
    train_process.det2d_model_train(dir_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easy_tools/easyai_train.py", line 61, in det2d_model_train
    class_names = self.sample_process.create_class_names(self.train_path, TaskName.Detect2d_Task)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tools/sample_tool/sample_info_get.py", line 29, in create_class_names
    train_task_config = self.config_factory.get_config(task_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/config/utility/config_factory.py", line 20, in get_config
    result.load_config(config_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/config/utility/image_task_config.py", line 35, in load_config
    self.load_test_value(config_dict)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/config/utility/common_train_config.py", line 114, in load_test_value
    self.val_data = int(config_dict['val_data'])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'
lpj0822 commented 3 years ago

已经修改

foww-0001 commented 3 years ago

拉取新分支,训练denet后报错:

Traceback (most recent call last):
  File "easy_tools/easy_ai.py", line 69, in <module>
    train_main()
  File "easy_tools/easy_ai.py", line 60, in train_main
    train_process.det2d_model_train(dir_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easy_tools/easyai_train.py", line 66, in det2d_model_train
    train_task.train("denet", self.gpu_id, self.config_path, pretrain_model_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/train_task.py", line 31, in train
    task.train(self.train_path, self.val_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/det2d/detect2d_train.py", line 39, in train
    self.train_epoch(epoch, self.lr_scheduler, self.dataloader)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/det2d/detect2d_train.py", line 52, in train_epoch
    self.update_logger(i, self.total_images, epoch, loss_info)
AttributeError: 'Detection2dTrain' object has no attribute 'total_images'
lpj0822 commented 3 years ago

已修改