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

运行模型,报错:NoValidRevisionError ,请问有什么解决方案?

环境:

  1. python 3.10

运行代码如下:

from modelscope.pipelines.multi_modal.gridvlp_pipeline import GridVlpClassificationPipeline

pipeline = GridVlpClassificationPipeline('rgtjf1/multi-modal_gridvlp_classification_chinese-base-ecom-cate-large') inputs = pipeline.preprocess({'text': '女装快干弹力轻型短裤448575','image_url':'https://yejiabo-public.oss-cn-zhangjiakou.aliyuncs.com/alinlp/clothes.png'}) outputs = pipeline.forward(inputs) print(outputs)

错误如下:

2023-04-06 16:43:08,542 - modelscope - INFO - load checkpoint from modelscope rgtjf1/multi-modal_gridvlp_classification_chinese-base-ecom-cate-large Traceback (most recent call last): File "", line 1, in File "/root/anaconda3/lib/python3.10/site-packages/modelscope/pipelines/multi_modal/gridvlp_pipeline.py", line 182, in init super().init(model_name_or_path, **kwargs) File "/root/anaconda3/lib/python3.10/site-packages/modelscope/pipelines/multi_modal/gridvlp_pipeline.py", line 86, in init local_model_dir = snapshot_download( File "/root/anaconda3/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 94, in snapshot_download revision = _api.get_valid_revision( File "/root/anaconda3/lib/python3.10/site-packages/modelscope/hub/api.py", line 446, in get_valid_revision raise NoValidRevisionError( modelscope.hub.errors.NoValidRevisionError: The model: rgtjf1/multi-modal_gridvlp_classification_chinese-base-ecom-cate-large has no valid revision!

展开
收起
soliwolf 2023-04-06 16:51:50 776 0
1 条回答
写回答
取消 提交回答
  • 问题已解决。模型需要手动下载

    下载成功后,在代码内部指定模型的具体路径

    2023-04-07 10:29:02
    赞同 展开评论 打赏

包含图像描述、文本生成图片、版面分析、多模态表征、视觉问答、文档理解等多个领域

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载