PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

FPN网络训练时报错

Open rsj123 opened this issue 2 years ago • 2 comments

问题确认 Search before asking

  • [X] 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

Training

Bug描述 Describe the Bug

在rcnn包含fpn的网络中训练时报错

Traceback (most recent call last):
  File "tools/train.py", line 172, in <module>
    main()
  File "tools/train.py", line 168, in main
    run(FLAGS, cfg)
  File "tools/train.py", line 132, in run
    trainer.train(FLAGS.eval)
  File "/home/aistudio/PaddleDetection/ppdet/engine/trainer.py", line 506, in train
    outputs = model(data)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
    return self._dygraph_call_func(*inputs, **kwargs)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
    outputs = self.forward(*inputs, **kwargs)
  File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/meta_arch.py", line 59, in forward
    out = self.get_loss()
  File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/cascade_rcnn.py", line 125, in get_loss
    rpn_loss, bbox_loss, mask_loss = self._forward()
  File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/cascade_rcnn.py", line 94, in _forward
    self.inputs)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 930, in __call__
    return self._dygraph_call_func(*inputs, **kwargs)
  File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
    outputs = self.forward(*inputs, **kwargs)
  File "/home/aistudio/PaddleDetection/ppdet/modeling/heads/cascade_head.py", line 252, in forward
    rois_feat = self.roi_extractor(body_feats, rois, rois_num)
  File "/home/aistudio/PaddleDetection/ppdet/modeling/heads/roi_extractor.py", line 112, in __call__
    boxes=rois_dist[lvl],
UnboundLocalError: local variable 'rois_dist' referenced before assignment

复现环境 Environment

PaddlePaddle 2.3.2 python: 3.7.4 环境为ai studio环境

Bug描述确认 Bug description confirmation

  • [X] 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • [ ] 我愿意提交PR!I'd like to help by submitting a PR!

rsj123 avatar Sep 17 '22 15:09 rsj123

已定位问题,在gitee上的代码没有 #6927

rsj123 avatar Sep 17 '22 15:09 rsj123

gitee代码已更新

jerrywgz avatar Sep 19 '22 03:09 jerrywgz