UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch.

UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0

原因:

torch.floor_divide() 已弃用,将在未来的 PyTorch 版本中删除。它的名字用词不当,因为它实际上将商四舍五入为零而不是取其底数。要保持当前行为,请使用 torch.div() 和 rounding_mode='trunc' 。要实际执行楼层划分,请使用 torch.div() 和 rounding_mode='floor' 。

解决办法:torch.floor_divide — PyTorch 1.12 documentation

        Python torch.floor_divide用法及代码示例 - 纯净天空 (vimsky.com)

你可能感兴趣的:(解决报错技巧,pytorch,人工智能,python)