AiStudio训练用AiStudio提供的voc数据集训练yolo出错
Created by: Charlie-Wilson0211
aistudio@jupyter-134162-999157:~/work/PaddleDetection$ python tools/train.py -c configs/ppyolo/ppyolo.yml -o finetune_exclude_pretrained_params=['yolo_output'] --eval 2020-09-22 17:12:20,323-INFO: If regularizer of a Parameter has been set by 'fluid.ParamAttr' or 'fluid.WeightNormParamAttr' already. The Regularization[L2Decay, regularization_coeff=0.000500] in Optimizer will not take effect, and it will only be applied to other Parameters! 2020-09-22 17:12:24,415-INFO: places would be ommited when DataLoader is not iterable W0922 17:12:24.550705 4146 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 10.0 W0922 17:12:24.555946 4146 device_context.cc:260] device: 0, cuDNN Version: 7.6. 2020-09-22 17:12:28,030-WARNING: /home/aistudio/.cache/paddle/weights/ResNet50_vd_ssld_pretrained.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ] /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/io.py:1998: UserWarning: This list is not set, Because of Paramerter not found in program. There are: fc_0.b_0 fc_0.w_0 format(" ".join(unused_para_list))) 2020-09-22 17:12:36,350-INFO: places would be ommited when DataLoader is not iterable 2020-09-22 17:12:39,975-WARNING: fail to map op [Gt2YoloTarget_547705] with error: index 26 is out of bounds for axis 1 with size 26 and stack: Traceback (most recent call last): File "/home/aistudio/work/PaddleDetection/ppdet/data/reader.py", line 46, in call data = f(data, ctx) File "/home/aistudio/work/PaddleDetection/ppdet/data/transform/batch_operators.py", line 270, in call target[best_n, 6 + cls, gj, gi] = 1. IndexError: index 26 is out of bounds for axis 1 with size 26
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py:1070: UserWarning: The following exception is not an EOF exception. "The following exception is not an EOF exception.") Traceback (most recent call last): File "tools/train.py", line 368, in main() File "tools/train.py", line 241, in main outs = exe.run(compiled_train_prog, fetch_list=train_values) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1071, in run six.reraise(*sys.exc_info()) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/six.py", line 703, in reraise raise value File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1066, in run return_merged=return_merged) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1167, in _run_impl return_merged=return_merged) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 879, in _run_parallel tensors = exe.run(fetch_var_names, return_merged)._move_to_list() paddle.fluid.core_avx.EnforceNotMet:
C++ Call Stacks (More useful to developers):
0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&, char const*, int) 1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) 2 paddle::operators::SplitOp::InferShape(paddle::framework::InferShapeContext*) const 3 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const 4 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 5 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 6 paddle::framework::details::ComputationOpHandle::RunImpl() 7 paddle::framework::details::FastThreadedSSAGraphExecutor::RunOpSync(paddle::framework::details::OpHandleBase*) 8 paddle::framework::details::FastThreadedSSAGraphExecutor::RunOp(paddle::framework::details::OpHandleBase*, std::shared_ptr<paddle::framework::BlockingQueue > const&, unsigned long*) 9 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result, std::__future_base::_Result_base::_Deleter>, void> >::_M_invoke(std::_Any_data const&) 10 std::__future_base::_State_base::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&, bool&) 11 ThreadPool::ThreadPool(unsigned long)::{lambda()#1}::operator()() const
Python Call Stacks (More useful to users):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2610, in append_op attrs=kwargs.get("attrs", None)) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/nn.py", line 6199, in split type='split', inputs=inputs, outputs={'Out': outs}, attrs=attrs) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/losses/yolo_loss.py", line 322, in _calc_obj_loss gts = fluid.layers.split(gt_box, batch_size, dim=0) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/losses/yolo_loss.py", line 191, in _get_fine_grained_loss num_classes, downsample, self._ignore_thresh, scale_x_y) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/losses/yolo_loss.py", line 69, in call mask_anchors, self._ignore_thresh) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/anchor_heads/yolo_head.py", line 401, in get_loss self.prefix_name) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 85, in build gt_score, targets) File "/home/aistudio/work/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 159, in train return self.build(feed_vars, mode='train') File "tools/train.py", line 114, in main train_fetches = model.train(feed_vars) File "tools/train.py", line 368, in main()
Error Message Summary:
Error: The input's size along the split dimension must be evenly divisible by Attr(num_or_sections). But received Attr(num_or_sections) = 24, input(X)'s shape = [2, 50, 4], Attr(dim) = 0. [Hint: Expected input_axis_dim % num == 0, but received input_axis_dim % num:2 != 0:0.] at (/paddle/paddle/fluid/operators/split_op.h:41) [operator < split > error]
环境:python3.7.4+paddle1.8.4
配置文件: architecture: YOLOv3 use_gpu: true max_iters: 500000 log_smooth_window: 100 log_iter: 100 save_dir: output snapshot_iter: 10000 metric: VOC pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_ssld_pretrained.tar weights: output/ppyolo/model_final num_classes: 20 use_fine_grained_loss: true use_ema: true ema_decay: 0.9998
YOLOv3: backbone: ResNet yolo_head: YOLOv3Head use_fine_grained_loss: true
ResNet: norm_type: sync_bn freeze_at: 0 freeze_norm: false norm_decay: 0. depth: 50 feature_maps: [3, 4, 5] variant: d dcn_v2_stages: [5]
YOLOv3Head: anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]] anchors: [[10, 13], [16, 30], [33, 23], [30, 61], [62, 45], [59, 119], [116, 90], [156, 198], [373, 326]] norm_decay: 0. coord_conv: true iou_aware: true iou_aware_factor: 0.4 scale_x_y: 1.05 spp: true yolo_loss: YOLOv3Loss nms: MatrixNMS drop_block: true
YOLOv3Loss: batch_size: 24 ignore_thresh: 0.7 scale_x_y: 1.05 label_smooth: false use_fine_grained_loss: true iou_loss: IouLoss iou_aware_loss: IouAwareLoss
IouLoss: loss_weight: 2.5 max_height: 608 max_width: 608
IouAwareLoss: loss_weight: 1.0 max_height: 608 max_width: 608
MatrixNMS: background_label: -1 keep_top_k: 100 normalized: false score_threshold: 0.01 post_threshold: 0.01
LearningRate: base_lr: 0.00333 schedulers:
- !PiecewiseDecay
gamma: 0.1
milestones:
- 400000
- 450000
- !LinearWarmup start_factor: 0. steps: 4000
OptimizerBuilder: optimizer: momentum: 0.9 type: Momentum regularizer: factor: 0.0005 type: L2
READER: 'ppyolo_reader.yml'
TrainReader: dataset: !VOCDataSet dataset_dir: dataset/voc anno_path: trainval.txt use_default_label: false batch_size: 2
EvalReader: inputs_def: fields: ['image', 'im_size', 'im_id', 'gt_bbox', 'gt_class', 'is_difficult'] dataset: !VOCDataSet dataset_dir: dataset/voc anno_path: test.txt use_default_label: false
TestReader: dataset: !ImageFolder anno_path: dataset/voc/label_list.txt use_default_label: false