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

推理时发生错误:load_model() missing 1 required positional argument: 'use_sync_bn' #24

Open
sss008800 opened this issue Sep 19, 2024 · 2 comments

Comments

@sss008800
Copy link

Traceback (most recent call last):
File "/code/infer_api.py", line 10, in
infer_api = INFER_API()
File "/code/main_infer.py", line 76, in new
cls._instance.initialize()
File "/code/main_infer.py", line 89, in initialize
self.model = load_model('all', 2)
TypeError: load_model() missing 1 required positional argument: 'use_sync_bn'

@sss008800
Copy link
Author

self.model = load_model('all', 2)
修改为
self.model = load_model('all', 2, use_sync_bn=False)
能运行,但不知是否合理

@Fieldhunter
Copy link
Contributor

实在抱歉,use_sync_bn这个参数是为了解决另一个issue提出的在单卡环境下训练RepLKNet时出现的问题而加上去的。这个参数只作用于RepLKNet的训练,并不会对推理产生影响,所以您这么设置是合理的。十分感谢您的issue,后续会解决这个bug,对您在使用上造成的困扰深表歉意。如仍有问题,欢迎随时提出issue。

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