hustvl/YOLOP

jpg not found in tag??

Closed this issue · 2 comments

I changed the address of the dataset as suggested in the readme document, and only trained the object detection part, but got an error: File "E:\YOLOP-main\lib\dataset\bdd.py", line 38, in _get_db
with open(label_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'F:\datasets\det_annotations\train\0004a4c0-d4dff0ad.jpg'

我把数据集的地址按照readme文档里面的建议改了,且只训练目标检测部分,但是报错:File "E:\YOLOP-main\lib\dataset\bdd.py", line 38, in _get_db
with open(label_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'F:\datasets\det_annotations\train\0004a4c0-d4dff0ad.jpg'
好奇怪,我就改了下面这两部分:
QQ_1727944002866
QQ_1727944163534

我把图片放到标签文件夹下面,上面的错就不报了,然后就一直报这个错
UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte sequence
我在报错的地方指定 encoding='utf-8' 报错:
File "D:\miniconda\envs\torch\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

已经解决了,把bdd.py的第35行改成label_path = mask_path.replace(str(self.mask_root), str(self.label_root)).replace(".png", ".json")就可以了