我对Python和为深入学习而贴标签的数据非常陌生。为了给自定义数据集贴上标签,我已经安装了Labelimg程序,但是当我创建YOLO培训示例时,它一直在崩溃。每次打开程序并指定图像目录时,我都可以浏览图像,但是当我创建边界框并尝试单击"next image“按钮时,它会崩溃,并带有错误消息。
请注意,我遵循了这教程来安装Labelimg。
下面是我创建错误的方法:
conda activate labelimg
cd D:\labelimg
python labelimg.py D:\photo_directory D:\label.txt D\:classes.txt
然后打开程序,显示如下:
请注意,我正在尝试将示例导出为YOLO培训示例。图片的名字是"weed0“。每当我创建示例并单击"Next Image“按钮时,程序就会崩溃,出现以下错误:
Traceback (most recent call last):
File "labelimg.py", line 1299, in openNextImg
self.saveFile()
File "labelimg.py", line 1339, in saveFile
self._saveFile(savedPath)
File "labelimg.py", line 1371, in _saveFile
if annotationFilePath and self.saveLabels(annotationFilePath):
File "labelimg.py", line 837, in saveLabels
self.lineColor.getRgb(), self.fillColor.getRgb())
File "D:\labelimg\libs\labelFile.py", line 89, in saveYoloFormat
writer.save(targetFile=filename, classList=classList)
File "D:\labelimg\libs\yolo_io.py", line 64, in save
out_file = codecs.open(targetFile, 'w', encoding=ENCODE_METHOD)
File "D:\anaconda3\envs\labelimg\lib\codecs.py", line 898, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\weed0.txt'
在导出YOLO培训样本时,我能做些什么来确保程序不会崩溃?我已经做了一切,除了重新安装程序,这对我来说没有意义,因为我刚刚下载了它。
发布于 2021-01-28 09:12:42
只需删除位于C:\Users\your_account.labelImgSettings.pkl的文件C:\Users\your_account.labelImgSettings.pkl,删除该文件并再次打开该工具。
https://stackoverflow.com/questions/63929874
复制相似问题