开发者社区 > ModelScope模型即服务 > 自然语言处理 > 正文

本地安装正常,但是执行出错,报错如下:

2023-03-01 21:48:35,292 - modelscope - INFO - storing http://www.modelscope.cn/api/v1/models/damo/nlp_gpt3_text-generation_2.7B/repo?Revision=v1.1.0&FilePath=tokenizer.json in cache at /home/zxt/.cache/modelscope/hub/temp/tmp0ulfzxce Traceback (most recent call last): File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/import_utils.py", line 432, in _get_module return importlib.import_module('.' + module_name, self.name) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/models/nlp/gpt3/distributed_gpt3.py", line 25, in from megatron_util.model import (AttnMaskType, Float16Module, LayerNorm, File "/home/zxt/.local/lib/python3.10/site-packages/megatron_util/model/init.py", line 16, in from .fused_layer_norm import MixedFusedLayerNorm as LayerNorm File "/home/zxt/.local/lib/python3.10/site-packages/megatron_util/model/fused_layer_norm.py", line 23, in from megatron.mpu import make_viewless_tensor File "/home/zxt/.local/lib/python3.10/site-packages/megatron/mpu/init.py", line 32, in from .layers import (ColumnParallelLinear, ParallelEmbedding, File "/home/zxt/.local/lib/python3.10/site-packages/megatron/mpu/layers.py", line 23, in from deepspeed.utils.timer import SynchronizedWallClockTimer ModuleNotFoundError: No module named 'deepspeed'

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

Traceback (most recent call last): File "/home/zxt/a.py", line 7, in pipe = pipeline(Tasks.text_generation, model=model_id) File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 141, in pipeline return build_pipeline(cfg, task_name=task) File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 54, in build_pipeline return build_from_cfg( File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/registry.py", line 184, in build_from_cfg LazyImportModule.import_module(sig) File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/import_utils.py", line 456, in import_module importlib.import_module(module_name) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/pipelines/nlp/distributed_gpt3_pipeline.py", line 8, in from modelscope.models.nlp import DistributedGPT3 File "", line 1075, in _handle_fromlist File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/import_utils.py", line 416, in getattr value = getattr(module, name) File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/import_utils.py", line 415, in getattr module = self._get_module(self._class_to_module[name]) File "/home/zxt/.local/lib/python3.10/site-packages/modelscope/utils/import_utils.py", line 434, in _get_module raise RuntimeError( RuntimeError: Failed to import modelscope.models.nlp.gpt3.distributed_gpt3 because of the following error (look up to see its traceback): No module named 'deepspeed'

展开
收起
游客yfh77atuoinqs 2023-03-01 22:15:32 1264 0
1 条回答
写回答
取消 提交回答
  • IWa

    这个是需要GPU训练模型的.如果有GPU环境的话.可以通过下载依赖解决 - pip install deepspeed==0.7.2

    2023-03-04 10:50:44
    赞同 1 展开评论 打赏

包含命名实体识别、文本分类、分词、关系抽取、问答、推理、文本摘要、情感分析、机器翻译等多个领域

热门讨论

热门文章

相关电子书

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