使用colab的时候报错:
Disco Diffusion v5.61 [Now with portrait_generator_v001]
ModuleNotFoundError Traceback (most recent call last) <ipython-input-5-3c8357fba9cb> in <module> 46 try: ---> 47 import open_clip 48 except: 6 frames ModuleNotFoundError: No module named 'transformers' During handling of the above exception, another exception occurred: ModuleNotFoundError Traceback (most recent call last) /content/open_clip/src/open_clip/coca_model.py in <module> 15 from .model import CLIPTextCfg, CLIPVisionCfg, _build_vision_tower, _build_text_tower 16 from .generation_utils import top_a, top_k, top_p, prepare_inputs_for_generation ---> 17 from transformers import BeamSearchScorer, LogitsProcessorList, MinLengthLogitsProcessor, StoppingCriteriaList, MaxLengthCriteria 18 19 GENERATION_TYPES = { ModuleNotFoundError: No module named 'transformers' --------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the "Open Examples" button below. ---------------------------------------------------------------------------
如图:
其实很简单就是依赖问题,在报错的代码前加上
!pip install transformers
加上后如下图:
再重新跑一下就正常了哈