训练mask rcnn实例分割时报错:

Traceback (most recent call last):File "tools/train_net.py", line 203, in <module>main()File "tools/train_net.py", line 196, in mainmodel = train(cfg, args.local_rank, args.distributed)File "tools/train_net.py", line 84, in traincfg,File "/home/lyh/Domain-Adaptive-Faster-RCNN-PyTorch/maskrcnn_benchmark/engine/trainer.py", line 137, in do_da_trainfor iteration, ((source_images, source_targets, idx1), (target_images, target_targets, idx2)) in enumerate(zip(source_data_loader, target_data_loader), start_iter):File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in __next__return self._process_data(data)File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_datadata.reraise()File "/opt/conda/lib/python3.6/site-packages/torch/_utils.py", line 385, in reraiseraise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loopdata = fetcher.fetch(index)File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetchdata = [self.dataset[idx] for idx in possibly_batched_index]File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>data = [self.dataset[idx] for idx in possibly_batched_index]File "/home/lyh/Domain-Adaptive-Faster-RCNN-PyTorch/maskrcnn_benchmark/data/datasets/coco.py", line 95, in __getitem__target = target.clip_to_image(remove_empty=True)File "/home/lyh/Domain-Adaptive-Faster-RCNN-PyTorch/maskrcnn_benchmark/structures/bounding_box.py", line 223, in clip_to_imagereturn self[keep]File "/home/lyh/Domain-Adaptive-Faster-RCNN-PyTorch/maskrcnn_benchmark/structures/bounding_box.py", line 208, in __getitem__bbox.add_field(k, v[item])File "/home/lyh/Domain-Adaptive-Faster-RCNN-PyTorch/maskrcnn_benchmark/structures/segmentation_mask.py", line 203, in __getitem__selected_polygons.append(self.polygons[i])
IndexError: list index out of range

解决方法:

修改以下两个文件,将文件中的torch.uint8改为torch.bool即可

maskrcnn_benchmark/structures/segmentation_mask.py

maskrcnn_benchmark/modeling/balanced_positive_negative_sampler.py

maskrcnn训练问题报错:selected_polygons.append(self.polygons[i]) IndexError: list index out of range相关推荐

  1. maskrcnn selected_polygons.append(self.polygons[i]) IndexError: list index out of range

    项目场景: maskrcnn训练问题报错:selected_polygons.append(self.polygons[i]) IndexError: list index out of range ...

  2. 成功解决.append方法出现错误IndexError: list index out of range

    成功解决.append方法出现错误IndexError: list index out of range 目录 解决问题 解决方法 解决问题 .append方法出现错误IndexError: list ...

  3. Tensorflow CIFAR-10训练例子报错解决

    Tensorflow CIFAR-10训练例子报错解决 大部分是Api版本问题: AttributeError: 'module' object has no attribute 'SummaryWr ...

  4. 使用pcb-tools解码Gerber文件报错IndexError: list index out of range

    问题描述: 基于Github提供的示例代码编写: import gerber from gerber.render.cairo_backend import GerberCairoContext# R ...

  5. Git报错:fatal: Unable to create ‘xx/.git/index.lock‘: File exis

    一 报错:fatal: Unable to create 'xx/.git/index.lock': File exis 如下: $ git commit fatal: Unable to creat ...

  6. mmdetection训练出现:IndexError: list index out of range 错误

    mmdetection训练出现:IndexError: list index out of range 错误 文章目录: 1 问题分析 1.1 尝试解决错误:第一次 1.2 尝试解决错误:第二次 2 ...

  7. Sampler 在数据下沉模式超时; 不同Sampler策略,在非数据下沉模式下,模型训练失败 报错Segmentation fault(core dumped)

    环境版本 mindspore-ascend 1.7.1 背景 我在使用自定义Sampler策略,对imagenet1K数据集进行采样,进行ResNet50训练. Sampler代码如下: class ...

  8. 姿态估计1-02:HR-Net(人体姿态估算)-官方模型训练测试-报错解决

    以下链接是个人关于HR-Net(人体姿态估算)所有见解,如有错误欢迎大家指出,我会第一时间纠正.有兴趣的朋友可以加微信:17575010159 相互讨论技术.若是帮助到了你什么,一定要记得点赞!因为这 ...

  9. 使用GPU训练yolo_v2报错:RuntimeError: CUDA out of memory. Tried to allocate XXX MiB

    报错内容: RuntimeError: CUDA out of memory. Tried to allocate 200.00 MiB (GPU 0; 8.00 GiB total capacity ...

最新文章

  1. OC从plist文件中获取数据
  2. 工作日志之个人统计篇
  3. 【Tiny4412】搭建Qt网络文件系统
  4. 【资讯】全球瞩目!无人驾驶真的来了!
  5. 能“社交”的机器人助理问世 可“察言观色”
  6. Ubuntu学习日记--Lesson7:文件权限管理chmod
  7. 中文NER碎碎念—聊聊词汇增强与实体嵌套
  8. linux-uboot 移植四 uboot的移植
  9. PMBOK(第六版) PMP笔记——《十二》第十二章(项目采购管理)
  10. 树莓派学习-I2c通信
  11. python共有前缀_最长公共前缀-Python
  12. vue之ele中的table组件(复选框的回显和重置)
  13. 超威主板关闭超线程教程
  14. 第二节 物料清单(BOM)
  15. 微信小程序-枯木学习笔记2-我的第一个小程序
  16. Unity 异常记录日志功能
  17. 结合阿里云 FC 谈谈我对 FaaS 的理解
  18. Luogu P2448 无尽的生命
  19. 2018最新北风网人工智能全套分享
  20. Linux X 视窗编程基础

热门文章

  1. Ebean报错java.lang.ClassCastException: com.project.model.xxx cannot be cast to com.project.model.xxx
  2. 河北正定县2010年政府工作报告(2)
  3. jetson nano开电源_NVIDIA Jetson Nano开发者套件入门指南
  4. 百度api英文验证码
  5. 【Java基础】2020如何查看Java官方文档
  6. android 5.1 壁纸路径,Android5.1 壁纸来源选项中有两个“壁纸”选项
  7. CVE-2018-1273漏洞复现
  8. android 调用原生分享功能,调用Android 系统自带分享功能
  9. Oracle Database 12c新特性 In-Database Archiving数据库内归档
  10. 超体分享 | 迭代思维:你感觉原地踏步,只是因为你想一步到位