Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pt文件只有一个类不能用吗? #3

Open
Htongbin opened this issue Jun 9, 2022 · 3 comments
Open

pt文件只有一个类不能用吗? #3

Htongbin opened this issue Jun 9, 2022 · 3 comments

Comments

@Htongbin
Copy link

Htongbin commented Jun 9, 2022

当自己的模型只有一个类别的时候不能读取pt文件,需要修改哪部分代码可以进行一个类自动标注吗?

@wufan-tb
Copy link
Owner

应该可以吧,pt有没有放到指定位置,具体报错是什么呢

@Htongbin
Copy link
Author

有的,pt放在指定weights文件夹下,可以识别到模型,然后报了这个错误
56546

@wufan-tb
Copy link
Owner

wufan-tb commented Jun 13, 2022

奥,可能是选标注类别的时候长度为1的列表会报错,可以试试这两种方法(选一个就好):

  1. labelImg.py的第2342行,把函数入参里面的 choices=tuple(names) 改为 choices=tuple(names+["background"])
  2. 在labelImg.py的第2341行下面加一句names.append("background")
    注意后面勾标注类别的时候别把这个背景选上了就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants