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.59k stars 2.86k forks source link

bug?- #9079

Closed etaixiee closed 3 days ago

etaixiee commented 1 month ago

问题描述 Please describe your issue

执行到PaddleDetection-release-2.7/ppdet/modeling/transformers/utils.py get_contrastive_denoising_training_group 268行 mask = paddle.rand(input_query_class.shape) < (label_noise_ratio 0.5) chosen_idx = paddle.nonzero(mask pad_gt_mask).squeeze(-1) 报错: File "/data/sonald/xiao/project/uos/PaddleDetection_clean/PaddleDetection-release-2.7/ppdet/modeling/transformers/utils.py", line 268, in get_contrastive_denoising_training_group chosen_idx = paddle.nonzero(mask * pad_gt_mask).squeeze(-1) TypeError: (InvalidType) Type promotion only support calculations between floating-point numbers and between complex and real numbers. But got different data type x: bool, y: float32. (at ../paddle/phi/common/type_promotion.h:164) 我打印了print(2222, mask, pad_gt_mask),输出: Tensor(shape=[2384], dtype=bool, place=Place(gpu:0), stop_gradient=True, [True , False, False, ..., False, False, False]) Tensor(shape=[2384], dtype=float32, place=Place(gpu:0), stop_gradient=True, [1., 1., 1., ..., 0., 0., 0.]) bool和float相乘失败。麻烦看下

etaixiee commented 1 month ago

mask = paddle.cast(mask, dtype='float32')换一下格式 能正常运行了

lyuwenyu commented 1 month ago

develop已修复

TingquanGao commented 1 month ago

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao commented 3 days ago

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot