Loading...

报错内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
(ab) (base) root@b11a13895df1:/cyb/LAVIS# bash run_scripts/blip2/train/pretrain_stage1.sh
Traceback (most recent call last):
File "/cyb/LAVIS/train.py", line 16, in <module>
import lavis.tasks as tasks
File "/cyb/LAVIS/lavis/__init__.py", line 16, in <module>
from lavis.models import *
File "/cyb/LAVIS/lavis/models/__init__.py", line 43, in <module>
from lavis.models.blip_diffusion_models.blip_diffusion import BlipDiffusion
File "/cyb/LAVIS/lavis/models/blip_diffusion_models/blip_diffusion.py", line 29, in <module>
from lavis.models.blip_diffusion_models.modeling_ctx_clip import CtxCLIPTextModel
File "/cyb/LAVIS/lavis/models/blip_diffusion_models/modeling_ctx_clip.py", line 13, in <module>
from transformers.models.clip.modeling_clip import (
ImportError: cannot import name '_expand_mask' from 'transformers.models.clip.modeling_clip' (/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/models/clip/modeling_clip.py)
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 16897) of binary: /root/anaconda3/envs/ab/bin/python


解决方法

版本问题:

1
pip install transformers==4.31.0