PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.81k stars 2.89k forks source link

PP-Vehicle 跟踪检测,超轻量tiny模型如何训练? #8883

Open littlesmallrookie opened 8 months ago

littlesmallrookie commented 8 months ago

问题确认 Search before asking

请提出你的问题 Please ask your question

我们需要在边缘端进行车辆跟踪检测任务,边缘服务需要消耗小,性能快。请问在PP-Vehicle快速使用文档中,超轻量模型JetSon AGX 模型的训练流程是怎样的? 我直接使用configs/ppvehicle/ppyoloe_plus_crn_t_auxhead_320_60e_ppvehicle.yml 训练时报错如下: Traceback (most recent call last): File "tools/train.py", line 202, in main() File "tools/train.py", line 198, in main run(FLAGS, cfg) File "tools/train.py", line 151, in run trainer.train(FLAGS.eval) File "/paddle/PaddleDetection/ppdet/engine/trainer.py", line 539, in train outputs = model(data) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/nn/layer/layers.py", line 1254, in call return self.forward(*inputs, kwargs) File "/paddle/PaddleDetection/ppdet/modeling/architectures/meta_arch.py", line 60, in forward out = self.get_loss() File "/paddle/PaddleDetection/ppdet/modeling/architectures/ppyoloe.py", line 257, in get_loss return self._forward() File "/paddle/PaddleDetection/ppdet/modeling/architectures/ppyoloe.py", line 224, in _forward loss = self.yolo_head( File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/nn/layer/layers.py", line 1254, in call return self.forward(*inputs, *kwargs) File "/paddle/PaddleDetection/ppdet/modeling/heads/ppyoloe_head.py", line 264, in forward return self.forward_train(feats, targets, aux_pred) File "/paddle/PaddleDetection/ppdet/modeling/heads/ppyoloe_head.py", line 198, in forward_train return self.get_loss([ File "/paddle/PaddleDetection/ppdet/modeling/heads/ppyoloe_head.py", line 439, in get_loss self.assigner( File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/nn/layer/layers.py", line 1254, in call return self.forward(inputs, kwargs) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), *kw) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/fluid/dygraph/base.py", line 347, in _decorate_function return func(args, *kwargs) File "/paddle/PaddleDetection/ppdet/modeling/assigners/task_aligned_assigner.py", line 142, in forward is_in_gts = is_close_gt(anchor_points, gt_bboxes, num_anchors_list) File "/paddle/PaddleDetection/ppdet/modeling/assigners/task_aligned_assigner.py", line 50, in is_close_gt dist_ratio[dist < max_dist] = 1. File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/fluid/dygraph/tensor_patch_methods.py", line 786, in setitem return _setitemimpl(self, item, value) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/fluid/variable_index.py", line 738, in _setitemimpl return set_value_for_bool_tensor(var, slice_item, value) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/fluid/variable_index.py", line 858, in set_value_for_bool_tensor cond(item.any(), lambda: idx_not_empty(var, item, value)) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/static/nn/control_flow.py", line 975, in cond pred = pred.item() File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/paddle/fluid/dygraph/tensor_patch_methods.py", line 581, in item scalar = self._getitem_from_offset(args) OSError: (External) CUDA error(719), unspecified launch failure. [Hint: 'cudaErrorLaunchFailure'. An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointerand accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases canbe found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work willreturn the same error. To continue using CUDA, the process must be terminated and relaunched.] (at ../paddle/phi/backends/gpu/cuda/cuda_info.cc:267)

lyuwenyu commented 8 months ago

先确定下paddle安装的版本没问题

littlesmallrookie commented 8 months ago

上面这个问题是因为预训练文件选错了。训练完后是可以使用的。 但是开启MKL加速推理的时候又报错了,请问是为什么? DET model dir: output_inference/ppyoloe_plus_crn_t_auxhead_320_60e_ppvehicle/ppyoloe_plus_crn_t_auxhead_320_60e_ppvehicle/ MOT model dir: output_inference/ppyoloe_plus_crn_t_auxhead_320_60e_ppvehicle/ppyoloe_plus_crn_t_auxhead_320_60e_ppvehicle/ LANE_SEG model dir: /root/.cache/paddle/infer_weights/pp_lite_stdc2_bdd100k ----------- Model Configuration ----------- Model Arch: PPYOLOE Transform Order: --transform op: Resize --transform op: NormalizeImage --transform op: Permute

video fps: 29, frame_count: 856 Thread: 0; frame id: 0 Traceback (most recent call last): File "deploy/pipeline/pipeline.py", line 1321, in main() File "deploy/pipeline/pipeline.py", line 1308, in main pipeline.run_multithreads() File "deploy/pipeline/pipeline.py", line 179, in run_multithreads self.predictor.run(self.input) File "deploy/pipeline/pipeline.py", line 533, in run self.predict_video(input, thread_idx=thread_idx) File "deploy/pipeline/pipeline.py", line 753, in predict_video res = self.mot_predictor.predict_image( File "/paddle/PaddleDetection/deploy/pptracking/python/mot_sde_infer.py", line 539, in predict_image result = self.predict() File "/paddle/PaddleDetection/deploy/pptracking/python/det_infer.py", line 167, in predict self.predictor.run() RuntimeError: could not create a primitive descriptor for a reorder primitive