"源镜像
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install modelscope==1.6.1, 1.9.5【均尝试】
pip install transformers
可以正常运行
docker commit 源镜像id 新镜像
ModelScope报错,怎么解决?:Exception: During ast indexing the file /usr/local/lib/python3.7/dist-packages/modelscope/models/base/base_torch_head.py, a related error excepted in the file /usr/local/lib/python3.7/dist-packages/modelscope/utils/ast_utils.py at line: 151: ""attr = getattr(node, field)"" with error msg: ""AttributeError: 'ClassDef' object has no attribute 'type_params'"", please double check the origin file /usr/local/lib/python3.7/dist-packages/modelscope/models/base/base_torch_head.py to see whether the file is correctly edited."
您换个镜像,比如nvidia torch镜像,安装torch,modelscope,运行模型推理,然后测一下docker commit是否会出现同样的报错。 此回答整理自钉群“魔搭ModelScope开发者联盟群 ①”
ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352