mmdet复现遇到的问题——UserWarning: __floordiv__ is deprecated
一、报错信息
UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of
pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor').
This results in incorrect rounding for negative values. To keep the current behavior, use
torch.div(a, b, rounding_mode='trunc'), or for actual floor division,
use torch.div(a, b, rounding_mode='floor').
scales = 0.5 + (areas - min_area) // (max_area - min_area)
二、错误分析
大概意思就是向下取整运算符 // 已经被废弃,使用torch.div(a,b,rounding_mode=‘floor’)或者torch.div(a,b,rounding_mode=‘trunc’)
torch.div(a,b,rounding_mode

浙公网安备 33010602011771号