开发者社区 > ModelScope模型即服务 > 正文

ModelScope模型导出为什么报以上错误?

"You are using a model of type mt5 to instantiate a model of type t5. This is not supported for all configurations of models and can yield errors.
D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\torch_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
return self.fget.get(instance, owner)()
2024-03-07 15:17:05,868 - modelscope - WARNING - ('EXPORTERS', 'text2text-generation', 'T5') not found in ast index file
Traceback (most recent call last):
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\base.py"", line 52, in from_model
exporter = build_exporter(export_cfg, task_name, kwargs)
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\builder.py"", line 20, in build_exporter
return build_from_cfg(
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\utils\registry.py"", line 198, in build_from_cfg
raise KeyError(
KeyError: 'T5 is not in the exporters registry group text2text-generation. Please make sure the correct version of ModelScope library is used.'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File ""F:\study\graduationProject\openingReport\nlp_mt5_zero-shot-augment_chinese-base\onnx.py"", line 6, in
output_files = Exporter.from_model(model).export_onnx(opset=13, output_dir='./model.onnx') #指定输出的ONNX文件所在的目录(output_dir),ONNX的操作集版本(opset)。
File ""D:\tool\Anaconda\anaconda3\envs\modelscope\lib\site-packages\modelscope\exporters\base.py"", line 54, in from_model
raise KeyError(
KeyError: ""The exporting of model 'T5' with task: 'text2text-generation' is not supported currently.""
ModelScope模型导出为什么报以上错误?
代码用的是这个
from modelscope.models import Model
from modelscope.pipelines import pipeline
from modelscope.exporters import Exporter
model_id = 'damo/nlp_mt5_zero-shot-augment_chinese-base'
model = Model.from_pretrained(model_id)
output_files = Exporter.from_model(model).export_onnx(opset=13, output_dir='./model.onnx') #指定输出的ONNX文件所在的目录(output_dir),ONNX的操作集版本(opset)。
print(output_files)
"

展开
收起
小小爱吃香菜 2024-03-12 19:57:23 107 0
1 条回答
写回答
取消 提交回答

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载