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

KEYERROR #4

Open
wk19990213 opened this issue Nov 21, 2024 · 6 comments
Open

KEYERROR #4

wk19990213 opened this issue Nov 21, 2024 · 6 comments

Comments

@wk19990213
Copy link

image
目前还在查找解决办法,希望作者或者其他好心人能帮忙解决,谢谢你的帮助

@wk19990213
Copy link
Author

上网搜了一些办法,说的是要运行setup.py,但是我并没有在项目中找到这个文件,期待回复

@gitdzy
Copy link
Collaborator

gitdzy commented Nov 22, 2024

这个问题我之前也遇到过几次,应该不会是setup.py的问题,我们的项目里面本来就没有setup.py这个文件。

我遇到的问题主要:

  1. 是环境路径的问题,为此我在train.py和test.py中都加上了
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

这几行代码,把当前目录添加到工作目录中。

  1. 也有可能是环境中本来就有mmseg库,导致和mmseg文件夹冲突了

  2. 或者是需要把 XXX 添加到__init__.py中

  3. 或者执行一下pip install -e .,这个的作用大概就是把本地目录链接为python的库

这个问题的原因挺多种的,上面那些都是我试过的,说不定能解决。

@wk19990213
Copy link
Author

这个问题我之前也遇到过几次,应该不会是setup.py的问题,我们的项目里面本来就没有setup.py这个文件。

我遇到的问题主要:

  1. 是环境路径的问题,为此我在train.py和test.py中都加上了
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

这几行代码,把当前目录添加到工作目录中。

  1. 也有可能是环境中本来就有mmseg库,导致和mmseg文件夹冲突了
  2. 或者是需要把 XXX 添加到__init__.py中
  3. 或者执行一下pip install -e .,这个的作用大概就是把本地目录链接为python的库

这个问题的原因挺多种的,上面那些都是我试过的,说不定能解决。

感谢,祝万事胜意,多发paper

@muyuerong
Copy link

Author
请问你的问题解决了吗?我也遇到了相同的问题

@gaoboyi
Copy link

gaoboyi commented Dec 5, 2024

i have the same issue ,how do you solve it?

@gitdzy
Copy link
Collaborator

gitdzy commented Dec 5, 2024

Author
请问你的问题解决了吗?我也遇到了相同的问题

i have the same issue ,how do you solve it?

Thanks for pointing out this issue. There are several possible reasons for it, and I'm not sure exactly what the cause is.

I've just found that the __init__.py file in /mmseg/models was missing on my GitHub code. I have already added this missing file now.

You can pull the latest code again. I hope it will solve the problem.

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

4 participants