微凉的衣柜 2020-06-29 14:45 采纳率: 63.9%
浏览 8228
已采纳

pytorch point源代码出现KeyError: Caught KeyError in DataLoader worker process 0.如何解决?

我使用的是https://github.com/fxia22/pointnet.pytorch
pointnet的源代码,运行train_classification.py后出现如下错误:

Traceback (most recent call last):
  File "D:/学习资料/博三/点云处理教程/pointnet/pointnet.pytorch/utils/train_classification.py", line 159, in <module>
    sys.exit(main())
  File "D:/学习资料/博三/点云处理教程/pointnet/pointnet.pytorch/utils/train_classification.py", line 110, in main
    for i, data in enumerate(dataloader, 0):
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 345, in __next__
    data = self._next_data()
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
    return self._process_data(data)
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
    data.reraise()
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\_utils.py", line 395, in reraise
    raise self.exc_type(msg)
KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "D:\ANA\envs\pytorch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "D:\学习资料\博三\点云处理教程\pointnet\pointnet.pytorch\pointnet\dataset.py", line 170, in __getitem__
    cls = self.cat[fn.split('/')[0]]
KeyError: 'sofa_0457'

想知道如何解决这类问题,或者什么源代码比较好跑一些,被这个折磨很久了

  • 写回答

2条回答 默认 最新

  • dabocaiqq 2020-08-12 09:40
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 (标签-STM32|关键词-智能小车)
  • ¥20 关于#stm32#的问题,请各位专家解答!
  • ¥15 (标签-python)
  • ¥15 第一个已完成,求第二个做法
  • ¥20 搭建awx,试了很多版本都有错
  • ¥15 java corba的客户端该如何指定使用本地某个固定IP去连接服务端?
  • ¥15 activiti工作流问题,求解答
  • ¥15 有人写过RPA后台管理系统么?
  • ¥15 Bioage计算生物学年龄
  • ¥20 如何将FPGA Alveo U50恢复原来出厂设置哇?