RuntimeError:在 DataLoader 工作进程 3 中捕获 RuntimeError

发布于 2025-01-15 14:13:52 字数 1515 浏览 2 评论 0原文

我在尝试在单个 GPU 上训练模型时遇到了这个问题;我检查了张量形状,它的大小调整得很好

RuntimeError: Caught RuntimeError in DataLoader worker process 3.
Original Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\new\lib\site-packages\torch\utils\data\_utils\worker.py", line 202, in _worker_loop
    data = fetcher.fetch(index)
  File "C:\ProgramData\Anaconda3\envs\new\lib\site-packages\torch\utils\data\_utils\fetch.py", line 28, in fetch
    data.append(next(self.dataset_iter))
  File "c:\users\anaszafar\desktop\train\detectron2\detectron2\data\common.py", line 201, in __iter__
    yield self.dataset[idx]
  File "c:\users\anaszafar\desktop\train\detectron2\detectron2\data\common.py", line 90, in __getitem__
    data = self._map_func(self._dataset[cur_idx])
  File "c:\users\anaszafar\desktop\train\adelaidet\adet\data\fcpose_dataset_mapper.py", line 62, in __call__
    raise
RuntimeError: No active exception to reraise

def __call__(self, dataset_dict):
        for i in range(100):
            dataset_dict_temp = copy.deepcopy(dataset_dict)
            dataset_dict_temp = super().__call__(dataset_dict_temp)
            if len(dataset_dict_temp["instances"]) != 0:
                if self.is_train:
                    dataset_dict_temp['instances'] = self.HeatmapGenerator(dataset_dict_temp['instances'], 
                                                                        self.gt_heatmap_stride)
                return dataset_dict_temp
        raise

I am having this issue while trying to train my model on a single GPU; I checked the tensors shape it is resizing fine

RuntimeError: Caught RuntimeError in DataLoader worker process 3.
Original Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\new\lib\site-packages\torch\utils\data\_utils\worker.py", line 202, in _worker_loop
    data = fetcher.fetch(index)
  File "C:\ProgramData\Anaconda3\envs\new\lib\site-packages\torch\utils\data\_utils\fetch.py", line 28, in fetch
    data.append(next(self.dataset_iter))
  File "c:\users\anaszafar\desktop\train\detectron2\detectron2\data\common.py", line 201, in __iter__
    yield self.dataset[idx]
  File "c:\users\anaszafar\desktop\train\detectron2\detectron2\data\common.py", line 90, in __getitem__
    data = self._map_func(self._dataset[cur_idx])
  File "c:\users\anaszafar\desktop\train\adelaidet\adet\data\fcpose_dataset_mapper.py", line 62, in __call__
    raise
RuntimeError: No active exception to reraise

def __call__(self, dataset_dict):
        for i in range(100):
            dataset_dict_temp = copy.deepcopy(dataset_dict)
            dataset_dict_temp = super().__call__(dataset_dict_temp)
            if len(dataset_dict_temp["instances"]) != 0:
                if self.is_train:
                    dataset_dict_temp['instances'] = self.HeatmapGenerator(dataset_dict_temp['instances'], 
                                                                        self.gt_heatmap_stride)
                return dataset_dict_temp
        raise

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾北清歌寒 2025-01-22 14:13:52

看起来您的代码抛出了异常,但没有有意义的错误消息。查看函数 __call__ 中第 62 行附近的 c:\users\anaszafar\desktop\train\adelaidet\adet\data\fcpose_dataset_mapper.py 中的代码,看看为什么你的数据集代码决定引发一个非特定错误。

It seems like your code throws an exception without a meaningful error message. Look at the code in c:\users\anaszafar\desktop\train\adelaidet\adet\data\fcpose_dataset_mapper.py around line 62 in the function __call__ and see why your dataset code decided to raise an unspecific error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文