labelImg icon indicating copy to clipboard operation
labelImg copied to clipboard

TypeError: expected str, bytes or os.PathLike object, not NoneType Aborted (core dumped)

Open knotgrass opened this issue 3 years ago • 17 comments

  • OS: ubuntu 20.04
  • PyQt version: pyqt5==5.14.1 ; PyQt5-sip==12.11.0

I build labelImg from source in July18 - 2022 and i have a problem when i open folder contain xml annotation But i install using pip , every seem OK If you want more infomation, please let me know. Thank you Here is console log.

(base) user@PCname:~/snap/labelImg$ python labelImg.py 
/home/agent/snap/labelImg/labelImg.py:213: DeprecationWarning: an integer is required (got type DockWidgetFeatures).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  self.dock.setFeatures(self.dock.features() ^ self.dock_features)
Traceback (most recent call last):
  File "/home/agent/snap/labelImg/labelImg.py", line 1309, in change_save_dir_dialog
    self.show_bounding_box_from_annotation_file(self.file_path)
  File "/home/agent/snap/labelImg/labelImg.py", line 1182, in show_bounding_box_from_annotation_file
    basename = os.path.basename(os.path.splitext(file_path)[0])
  File "/home/agent/anaconda3/lib/python3.9/posixpath.py", line 118, in splitext
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Aborted (core dumped)

knotgrass avatar Jul 18 '22 06:07 knotgrass

Hello,

Have you sovled this problem? I had the same one as you

Evelyn0402 avatar Jul 27 '22 10:07 Evelyn0402

Hello,

Have you sovled this problem? I had the same one as you

i using pip to install, and i can using labelImg

knotgrass avatar Jul 28 '22 08:07 knotgrass

pip install also works for me, thanks!

Evelyn0402 avatar Jul 28 '22 08:07 Evelyn0402

pip install works thanks

Overlrd avatar Aug 10 '22 13:08 Overlrd

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

xavier-dc avatar Aug 24 '22 14:08 xavier-dc

this works, thanks

AaronG18 avatar Sep 01 '22 02:09 AaronG18

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

thanks a lot

AaronG18 avatar Sep 01 '22 02:09 AaronG18

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thanks, this works!!

haltersweb avatar Sep 08 '22 18:09 haltersweb

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thanks, it works!!!

WangYutongNEU avatar Nov 11 '22 13:11 WangYutongNEU

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string. thank you

Haastrup88 avatar Dec 05 '22 18:12 Haastrup88

The problem seems to occur after the application starts, hits the "open_dir" button to determine the image directory, and determines the save directory.

This issue was added in commit 5bc7fb9 .

As a countermeasure other than editing the code, it seems that the problem can be avoided by unchecking the "auto_save" checkbox.

KAkikakuFukuhara avatar Jan 06 '23 05:01 KAkikakuFukuhara

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string. thank you

where does one have to change this line.... in which file? ......facinf the same error on my Mac while using labelImg

Shrutikute09 avatar Jan 23 '23 15:01 Shrutikute09

maybe here. https://github.com/heartexlabs/labelImg/blob/master/labelImg.py#L1309

KAkikakuFukuhara avatar Jan 24 '23 02:01 KAkikakuFukuhara

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

Thank you, It works 👍🏽

VikashPR avatar Mar 05 '23 04:03 VikashPR

I resolved this problem by changing line 1309 to "self.show_bounding_box_from_annotation_file(str(self.file_path))" to force it to a string.

This really works! Even though I tried git pull from the repository it says: Already up to date! Since labelImg changed a while ago, this was one of the most efficient solutions, thxx.

semanurbilada avatar Apr 02 '23 07:04 semanurbilada

what after pip install ...?

NodirbekSE avatar Apr 29 '23 17:04 NodirbekSE

expected str, bytes or os.PathLike object, not NoneType how to resolve this i tried reinstalling it

bhavit89 avatar Aug 04 '23 09:08 bhavit89