labelImg无法正常使用的有效解决办法

使用的是labelImg-1.8.0,个人经验,使用python2可以方便正常使用。

下载地址https://github.com/ArmendLee/labelImg-1.8.0

下载后运行: python labelImg.py:

如果报错:
Traceback (most recent call last):
 File "labelImg.py", line 29, in <module>
   import resources
ImportError: No module named resources

解决方法:
屏蔽labelImg.py中29行的resources:
#import resources
方法一:使用系统中的python2环境(支持系统版本低的情况):
1.确认默认python版本:

终端输入python:

a.当默认版本为conda下的python时,屏蔽环境变量中的conda:

打开sudo gedit ~/.bashrc,屏蔽,source ~/.bashrc。

b. 查看系统下的python默认版本,如果不是python2,切换版本:

(1) sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
(2) sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
(3) 通过sudo update-alternatives --config python选择相应的序号选择Python版本.

切换为Python2
2. 安装库:
sudo apt-get install python-qt4
pip install lxm (未装pip时:sudo apt-get install python-pip)
运行python labelImg.py
方法二:使用conda中的torch环境(支持系统版本高的情况):
source activate torch1.7
pip install PyQt5, sip, lxml
python labelImg.py
  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值