Not find:/data/predefined_classes.txt (optional).TypeError: expected str, bytes or os.PathLike object, not NoneType
- OS: WIN11
- PyQt version: PyQt5 5.15.6
"D:\labelImg\data\predefined_classes.txt" existence
cd labelImg
python labelImg.py
Not find:/data/predefined_classes.txt (optional)
Traceback (most recent call last):
File "D:\0SDXX\labelImg\labelImg.py", line 1359, in open_dir_dialog
self.import_dir_images(target_dir_path)
File "D:\0SDXX\labelImg\labelImg.py", line 1374, in import_dir_images
self.open_next_image()
File "D:\0SDXX\labelImg\labelImg.py", line 1429, in open_next_image
self.change_save_dir_dialog()
File "D:\0SDXX\labelImg\labelImg.py", line 1309, in change_save_dir_dialog
self.show_bounding_box_from_annotation_file(self.file_path)
File "D:\0SDXX\labelImg\labelImg.py", line 1182, in show_bounding_box_from_annotation_file
basename = os.path.basename(os.path.splitext(file_path)[0])
File "D:\anaconda3\lib\ntpath.py", line 204, in splitext
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
找到解决办法了没??
I don't know what caused it
uninstall Reinstall
@yourdaddaddadd
This error happens to me several times. Try to copy the classes.txt file to the folder which has the frames
Got a solution to this yet?
If it is the first time you annotate images inside a folder, open any image in that folder from labelimg using “open” not “open dir”, annotate it and save the annotation *.txt file. Try then to use “open dir” to begin annotations with your folder.
The same error also happens when I resume annotations on a folder after a change has happened to the classes.txt file (a change from outside labelimg). In this case, I delete the classes.txt file from the working directory and restore the original one.
Thanks that was very helpful
Sent from my iPhone
On 29 Aug 2022, at 06:52, ahmedibrahim0100 @.***> wrote:
If it is the first time you annotate images inside a folder, open any image in that folder from labelimg using “open” not “open dir”, annotate it and save the annotation *.txt file. Try then to use “open dir” to begin annotations with your folder.
The same error also happens when I resume annotations on a folder after a change has happened to the classes.txt file (a change from outside labelimg). In this case, I delete the classes.txt file from the working directory and restore the original one.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
https://github.com/heartexlabs/labelImg/issues/967#issuecomment-1359672079 I solve the problem