马春杰杰 Exit Reader Mode

/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

使用colab进行训练时出现如下问题:

/usr/local/lib/python3.6/dist-packages/mmcv/runner/epoch_based_runner.py:181: UserWarning: Runner was deprecated, please use EpochBasedRunner instead
  'Runner was deprecated, please use EpochBasedRunner instead')
/usr/local/lib/python3.6/dist-packages/mmcv/runner/base_runner.py:63: UserWarning: batch_processor is deprecated, please implement train_step() and val_step() in the model instead.
  warnings.warn('batch_processor is deprecated, please implement '
2020-09-29 03:25:25,281 - mmdet - INFO - Start running, host: root@06ffd23f9f49, work_dir: 
2020-09-29 03:25:25,281 - mmdet - INFO - workflow: [('train', 1)], max: 24 epochs
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

经查,是pytorch版本的问题,当pytorch版本改为1.1.0时,该问题消失,如果对pytorch版本有要求,可以在train.py中加入:

import warnings
warnings.filterwarnings("ignore", category=UserWarning)

这也是目前官方推荐的解决方法。

本文最后更新于2020年10月29日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!