开发者社区 > ModelScope模型即服务 > 计算机视觉 > 正文

ModelScope中NLP模型加载模型时报错请问是为什么?

NLP模型:rex-uninlu
modelscope 版本:1.9.5
加载模型时报错:

semantic_cls = pipeline('rex-uninlu', model='damo/nlp_deberta_rex-uninlu_chinese-base', model_revision='v1.2.1')
2023-12-04 11:52:33,717 - modelscope - INFO - Use user-specified model revision: v1.2.1
2023-12-04 11:52:34,347 - modelscope - WARNING - ('PIPELINES', 'rex-uninlu', 'nlp_deberta_rex-uninlu_chinese-base-pipe') not found in ast index file
2023-12-04 11:52:34,347 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base
2023-12-04 11:52:34,348 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base.
2023-12-04 11:52:34,349 - modelscope - WARNING - No preprocessor field found in cfg.
2023-12-04 11:52:34,350 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2023-12-04 11:52:34,350 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/root/.cache/modelscope/hub/damo/nlp_deberta_rex-uninlu_chinese-base'}. trying to build by task and model information.
2023-12-04 11:52:34,350 - modelscope - WARNING - Find task: rex-uninlu, model type: None. Insufficient information to build preprocessor, skip building preprocessor
2023-12-04 11:52:34,350 - modelscope - INFO - cuda is not available, using cpu instead.
Traceback (most recent call last):
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/utils/registry.py", line 212, in build_from_cfg
return obj_cls(args)
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/ms_wrapper.py", line 29, in init
self.model, self.trainer = self.init_model(
kwargs)
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/ms_wrapper.py", line 32, in init_model
data_args, training_args, model_args = get_args()
File "/root/.cache/modelscope/modelscope_modules/nlp_deberta_rex-uninlu_chinese-base/rex/arguments.py", line 107, in get_args
data_args, training_args, model_args, remaining_args = parser.parse_args_into_dataclasses(return_remaining_strings=True)
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/transformers/hf_argparser.py", line 308, in parse_args_into_dataclasses
args_files.append(Path(sys.argv[0]).with_suffix(".args"))
File "/root/miniconda3/envs/nlp/lib/python3.8/pathlib.py", line 872, in with_suffix
raise ValueError("%r has an empty name" % (self,))
ValueError: PosixPath('.') has an empty name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 162, in pipeline
return build_pipeline(cfg, task_name=task)
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 65, in build_pipeline
return build_from_cfg(
File "/root/miniconda3/envs/nlp/lib/python3.8/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
ValueError: RexUniNLUPipeline: PosixPath('.') has an empty name

展开
收起
陈幕白 2023-12-13 12:55:11 181 0
2 条回答
写回答
取消 提交回答
  • 没看到你的代码,但是按照报错信息看你是不是没有传信息或者文件再或者你传的文件不存在或者路径错误,造成模型在初始化的时候参数不足报错了

    2023-12-13 13:40:26
    赞同 1 展开评论 打赏
  • 建议多多的看报错日志,自己循着日志找自己的配置错误。此回答整理自钉群 “魔搭ModelScope开发者联盟群 ①”

    2023-12-13 13:33:21
    赞同 展开评论 打赏

包含图像分类、图像生成、人体人脸识别、动作识别、目标分割、视频生成、卡通画、视觉评价、三维视觉等多个领域

相关电子书

更多
《搜索NLP行业模型和轻量化客户定制》 立即下载
自然语言理解技术与智能问答实践 立即下载
自然语言处理得十个发展趋势 立即下载