MiniBullLab / easy_ai

3 stars 1 forks source link

运行classnet训练报错 #81

Closed MiniBullLab closed 3 years ago

MiniBullLab commented 3 years ago

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

python easyai/train_task.py -t classify -i tests/.dataset/classnet_flower_2class_jpg/ImageSets/train.txt -v tests/.dataset/classnet_flower_2class_jpg/ImageSets/val.txt -m classnet

报错如下:

Traceback (most recent call last):
  File "easyai/train_task.py", line 61, in <module>
    main()
  File "easyai/train_task.py", line 56, in main
    train_task.train(options.model, 0, options.config_path, options.pretrainModel)
  File "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/cls/classify_train.py", line 22, in __init__
    self.classify_test = ClassifyTest(model_name, gpu_id, self.train_task_config)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/cls/classify_test.py", line 19, in __init__
    self.inference = Classify(model_name, gpu_id, config_path)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/cls/classify.py", line 21, in __init__
    self.result_process = ClassifyResultProcess(self.task_config.post_process)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/cls/classify_result_process.py", line 13, in __init__
    self.process_func = self.build_post_process(post_process_args)
  File "/home/wfw/workspace/EDGE/easy_ai/easyai/tasks/utility/task_result_process.py", line 26, in build_post_process
    func_name = post_process_args.strip()
AttributeError: 'dict' object has no attribute 'strip'
lpj0822 commented 3 years ago

已经修改

foww-0001 commented 3 years ago

测试过,bug解决。