Closed etaixiee closed 3 days ago
mask = paddle.cast(mask, dtype='float32')换一下格式 能正常运行了
develop已修复
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
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
问题描述 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相乘失败。麻烦看下