MiniBullLab/easy_ai

训练segnet报错

Closed this issue · 5 comments

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

python easy_tools/easy_ai.py -t SegNET -g 0 -i /home/wfw/workspace/EDGE/SiNGRAYNET_V0.4_Samples_20210514/SegNet_Sample/SegNet-screw_trainning_data/ImageSets/train.txt -v /home/wfw/workspace/EDGE/SiNGRAYNET_V0.4_Samples_20210514/SegNet_Sample/SegNet-screw_trainning_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 62, in train_main
    train_process.segment_model_train(dir_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easy_tools/easyai_train.py", line 79, in segment_model_train
    train_task.train("segnet", 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/seg/segment_train.py", line 19, in __init__
    self.set_model_param(data_channel=self.task_config.data_channel,
AttributeError: 'SegmentionTrain' object has no attribute 'task_config'

已修改

拉取最新分支,报错如下:

Traceback (most recent call last):
  File "easy_tools/easy_ai.py", line 69, in <module>
    train_main()
  File "easy_tools/easy_ai.py", line 62, in train_main
    train_process.segment_model_train(dir_name)
  File "/home/wfw/workspace/EDGE/easy_ai/easy_tools/easyai_train.py", line 79, in segment_model_train
    train_task.train("segnet", 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/seg/segment_train.py", line 23, in __init__
    self.train_task_config.post_prcoess)
AttributeError: 'SegmentionConfig' object has no attribute 'post_prcoess'

已经修改。

edge_tools中SegNet训练报错:

2021-06-26 17:45:51,206 ERROR   [train_task.py, 41] Traceback (most recent call last):
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/train_task.py", line 36, 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/seg/segment_train.py", line 26, in __init__
    self.segment_test = SegmentionTest(model_name, gpu_id, self.train_task_config)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/seg/segment_test.py", line 20, in __init__
    self.segment_inference = Segmentation(model_name, gpu_id, config_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/seg/segment.py", line 23, in __init__
    self.set_model(gpu_id=gpu_id)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/utility/base_inference.py", line 58, in set_model
    self.model = self.torchModelProcess.create_model(self.model_args, gpu_id)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/torch_utility/torch_model_process.py", line 28, in create_model
    model = self.modelFactory.get_model(model_config)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/model/utility/model_factory.py", line 34, in get_model
    result = self.get_model_from_name(model_args)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/model/utility/model_factory.py", line 61, in get_model_from_name
    model = self.get_seg_model(model_config)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/model/utility/model_factory.py", line 85, in get_seg_model
    model = build_from_cfg(model_config, REGISTERED_SEG_MODEL)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/utility/registry.py", line 107, in build_from_cfg
    return obj_cls(**args)
TypeError: __init__() got an unexpected keyword argument 'points_count'

2021-06-26 17:45:51,207 ERROR   [train_task.py, 42] __init__() got an unexpected keyword argument 'points_count'

已经修改