Bug 8032 - [ModelScope][容器镜像]默认未安装xformers依赖包,导致Video-to-Video、Image-to-Video2个官方模型无法直接运行
Summary: [ModelScope][容器镜像]默认未安装xformers依赖包,导致Video-to-Video、Image-to-Video2个官方模型无法直接运行
Status: NEW
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: Images&Installations (show other bugs) Images&Installations
Version: 8.8
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: zhongling
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-24 11:29 UTC by bolong_tbl
Modified: 2024-01-24 11:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bolong_tbl alibaba_cloud_group 2024-01-24 11:29:21 UTC
Description of problem:
镜像默认未安装xformers python依赖包,导致Video-to-Video、Image-to-Video2个官方模型无法直接运行,ModelScope社区Ubuntu镜像默认安装了xformers无该问题。

Version-Release number of selected component (if applicable):
镜像地址:registry.openanolis.cn/openanolis/modelscope:1.10.0-an8


Steps to Reproduce:
1. 启动容器docker run -it registry.openanolis.cn/openanolis/modelscope:1.10.0-an8
2. 根据ModelScope官网,找到模型对应的代码范例(code example),以Video-to-Video为例:

from modelscope.pipelines import pipeline	
from modelscope.outputs import OutputKeys	
 	
# VID_PATH: your video path	
# TEXT : your text description	
pipe = pipeline(task="video-to-video", model='damo/Video-to-Video', model_revision='v1.1.0', device='cuda:0')	
p_input = {	
            'video_path': VID_PATH,	
            'text': TEXT	
        }	
 	
output_video_path = pipe(p_input, output_video='./output.mp4')[OutputKeys.OUTPUT_VIDEO]	

3. 执行代码范例

Actual results:

执行报错
  File "/opt/conda/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1014, in _gcd_import
  File "", line 991, in _find_and_load
  File "", line 975, in _find_and_load_unlocked
  File "", line 671, in _load_unlocked
  File "", line 843, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/opt/conda/lib/python3.8/site-packages/modelscope/models/multi_modal/video_to_video/video_to_video_model.py", line 17, in 
    from modelscope.models.multi_modal.video_to_video.modules import *
  File "/opt/conda/lib/python3.8/site-packages/modelscope/models/multi_modal/video_to_video/modules/__init__.py", line 5, in 
    from .unet_v2v import *
  File "/opt/conda/lib/python3.8/site-packages/modelscope/models/multi_modal/video_to_video/modules/unet_v2v.py", line 9, in 
    import xformers
ModuleNotFoundError: No module named 'xformers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/cache/integration_tests/workspace/test_Video-to-Video.py", line 7, in 
    pipe = pipeline(task="video-to-video", model='damo/Video-to-Video', model_revision='v1.1.0', device='cuda:0')	
  File "/opt/conda/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 170, in pipeline
    return build_pipeline(cfg, task_name=task)
  File "/opt/conda/lib/python3.8/site-packages/modelscope/pipelines/builder.py", line 65, in build_pipeline
    return build_from_cfg(
  File "/opt/conda/lib/python3.8/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
ModuleNotFoundError: VideoToVideoPipeline: No module named 'xformers'

Expected results:
执行不报错

Additional info:
可手动安装依赖包解决