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

在用pyinstaller打包代码报错,但是验证内置模型就没问题KeyError: 'speech_dfsmn_kws_char_farfield is not in the pipelines registry group keyword-spotting. Please make sure the correct version of ModelScope library is used.' #847

Open
Earth-Julia opened this issue Apr 28, 2024 · 2 comments
Assignees

Comments

@Earth-Julia
Copy link

Earth-Julia commented Apr 28, 2024

介绍:
我原先安装的modelscope版本为1.1.1的,但是在网上看到说可以降低一下就又安装了1.10.0版本的,还是报这个信息,我在打包前使用官方的验证内置模型代码是没问题的,使用pyinstaller打包起来,运行.exe就报错了
代码报错信息如下:
D:\modelscope-kws-training-suite-main\dist>test4_luyin.exe
2024-04-29 01:14:24,320 - modelscope - INFO - PyTorch version 1.11.0 Found.
2024-04-29 01:14:24,320 - modelscope - INFO - Loading ast index from C:\Users\Administrator.cache\modelscope\ast_indexer
2024-04-29 01:14:24,334 - modelscope - INFO - No valid ast index found from C:\Users\Administrator.cache\modelscope\ast_indexer, generating ast index from prebuilt!
2024-04-29 01:14:24,335 - modelscope - INFO - AST-Scanning the path "C:\Users\Administrator\AppData\Local\Temp_MEI43202\modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters']
2024-04-29 01:14:24,335 - modelscope - INFO - Scanning done! A number of 0 components indexed or updated! Time consumed 0.001001119613647461s
2024-04-29 01:14:24,335 - modelscope - INFO - Loading done! Current index file version is 1.10.0, with md5 d41d8cd98f00b204e9800998ecf8427e and a total number of 0 components indexed
2024-04-29 01:14:24,956 - modelscope - WARNING - ('PIPELINES', 'keyword-spotting', 'speech_dfsmn_kws_char_farfield') not found in ast index file
Traceback (most recent call last):
File "test4_luyin.py", line 15, in
File "modelscope\pipelines\builder.py", line 170, in pipeline
File "modelscope\pipelines\builder.py", line 65, in build_pipeline
File "modelscope\utils\registry.py", line 198, in build_from_cfg
KeyError: 'speech_dfsmn_kws_char_farfield is not in the pipelines registry group keyword-spotting. Please make sure the correct version of ModelScope library is used.'
[21492] Failed to execute script 'test4_luyin' due to unhandled exception!

有没有解决方法呢,可以指导我一下嘛,非常感谢

@wenmengzhou
Copy link
Collaborator

2024-04-29 01:14:24,335 - modelscope - INFO - AST-Scanning the path "C:\Users\Administrator\AppData\Local\Temp_MEI43202\modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters']
2024-04-29 01:14:24,335 - modelscope - INFO - Scanning done! A number of 0 components indexed or updated! 

ast扫描代码除了问题,没有正确拿到模块的信息导致了报错, @zzhangpurdue 帮忙看下

@fenbays
Copy link

fenbays commented May 17, 2024

打包时使用参数--collect-all modelscope可以解决这个问题

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

3 participants