以下代码是出现错误的提示原因:
(pytorch) H:\语义分割项目\unet-pytorch-main>labelme
Traceback (most recent call last):
File "c:\users\person\anaconda3\envs\pytorch\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\person\anaconda3\envs\pytorch\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\person\Anaconda3\envs\pytorch\Scripts\labelme.exe\__main__.py", line 4, in <module>
File "c:\users\person\anaconda3\envs\pytorch\lib\site-packages\labelme\__init__.py", line 11, in <module>
QT4 = QT_VERSION[0] == '4'
TypeError: 'NoneType' object is not subscriptable
出现此错误是因为在安装labelme之前没有安装pyqt5,下面使用如下命令安装pyqt5:
(pytorch) H:\语义分割项目\unet-pytorch-main>pip install pyqt5 -i https://pypi.tuna.tsinghua.edu.cn/simple/
安装完成之后,再使用如下命令安装labelme:
(pytorch) H:\语义分割项目\unet-pytorch-main>pip install labelme==3.16.7 -i https://pypi.tuna.tsinghua.edu.cn/simple/
安装完成之后即可输入labelme打开界面进行标签标注:
(pytorch) H:\语义分割项目\unet-pytorch-main>labelme
希望可以帮到各位,有什么问题大家可以在下面评论。