你好!
我有一个问题,我在搜索时无法找到答案,希望你能帮助我。
我的问题是:
当我尝试用非英文数据集开始训练时,我遇到了这个错误:KeyError: Caught KeyError in DataLoader worker process 2.
原始异常(最近的一次):
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\indexes\range.py", line 385, in get_loc
return self._range.index(new_key)
ValueError: 111001 is not in range
上述异常是以下异常的直接原因:
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\data_utils\worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\data\dataset.py", line 290, in **getitem**
return self.dataset[self.indices[idx]]
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\data\dataset.py", line 235, in **getitem**
return self.datasets[dataset_idx][sample_idx]
File "D:\\train-error-16 mehr\\16-mehr-2\\EasyOCR-master\\trainer\\dataset.py", line 174, in **getitem**
img_fname = [self.df.at](http://self.df.at/) [index,'filename']
File "C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pandas\\core\\indexing.py", line 2275, in **getitem**
return super().**getitem**(key)
File "C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pandas\\core\\indexing.py", line 2226, in **getitem**
return self.obj._get_value(*key, takeable=self._takeable)
File "C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pandas\\core\\frame.py", line 3622, in _get_value
row = self.index.get_loc(index)
File "C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pandas\\core\\indexes\\range.py", line 387, in get_loc
raise KeyError(key) from err
KeyError: 111001`
谢谢你告诉我这个错误的原因并帮助我。谢谢!
1条答案
按热度按时间wsxa1bj11#
你好,@ftmasadi,你找到关于这个问题的任何信息了吗?