Error while running 1.Creating_a_simple_avatar.ipynb
Opened this issue · 0 comments
SuperMaximus1984 commented
Please advise what can be done to correct this?
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:857, in _LazyModule._get_module(self, module_name)
856 try:
--> 857 return importlib.import_module("." + module_name, self.__name__)
858 except Exception as e:
File ~\anaconda3\envs\avatar\lib\importlib\__init__.py:127, in import_module(name, package)
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1014, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:975, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:671, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:843, in exec_module(self, module)
File <frozen importlib._bootstrap>:219, in _call_with_frames_removed(f, *args, **kwds)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\onnx\config.py:35
34 if is_vision_available():
---> 35 from PIL import Image
37 logger = logging.get_logger(__name__)
File ~\anaconda3\envs\avatar\lib\site-packages\PIL\Image.py:100
94 try:
95 # If the _imaging C module is not present, Pillow will not load.
96 # Note that other modules should not refer to _imaging directly;
97 # import Image and use the Image.core variable instead.
98 # Also note that Image.core is not a publicly documented interface,
99 # and should be considered private and subject to change.
--> 100 from . import _imaging as core
102 if __version__ != getattr(core, "PILLOW_VERSION", None):
ImportError: DLL load failed while importing _imaging: The specified module could not be found.
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:857, in _LazyModule._get_module(self, module_name)
856 try:
--> 857 return importlib.import_module("." + module_name, self.__name__)
858 except Exception as e:
File ~\anaconda3\envs\avatar\lib\importlib\__init__.py:127, in import_module(name, package)
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1014, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:961, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:219, in _call_with_frames_removed(f, *args, **kwds)
File <frozen importlib._bootstrap>:1014, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:975, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:671, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:843, in exec_module(self, module)
File <frozen importlib._bootstrap>:219, in _call_with_frames_removed(f, *args, **kwds)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\models\__init__.py:19
1 # flake8: noqa
2 # There's no way to ignore "F401 '...' imported but unused" warnings in this
3 # module, but to preserve other warnings. So, don't check this module at all.
(...)
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
---> 19 from . import (
20 albert,
21 auto,
22 bart,
23 barthez,
24 bartpho,
25 beit,
26 bert,
27 bert_generation,
28 bert_japanese,
29 bertweet,
30 big_bird,
31 bigbird_pegasus,
32 blenderbot,
33 blenderbot_small,
34 bort,
35 byt5,
36 camembert,
37 canine,
38 clip,
39 convbert,
40 convnext,
41 cpm,
42 ctrl,
43 data2vec,
44 deberta,
45 deberta_v2,
46 decision_transformer,
47 deit,
48 detr,
49 dialogpt,
50 distilbert,
51 dit,
52 dpr,
53 dpt,
54 electra,
55 encoder_decoder,
56 flaubert,
57 fnet,
58 fsmt,
59 funnel,
60 glpn,
61 gpt2,
62 gpt_neo,
63 gptj,
64 herbert,
65 hubert,
66 ibert,
67 imagegpt,
68 layoutlm,
69 layoutlmv2,
70 layoutxlm,
71 led,
72 longformer,
73 luke,
74 lxmert,
75 m2m_100,
76 marian,
77 maskformer,
78 mbart,
79 mbart50,
80 megatron_bert,
81 megatron_gpt2,
82 mluke,
83 mmbt,
84 mobilebert,
85 mpnet,
86 mt5,
87 nystromformer,
88 openai,
89 pegasus,
90 perceiver,
91 phobert,
92 plbart,
93 poolformer,
94 prophetnet,
95 qdqbert,
96 rag,
97 realm,
98 reformer,
99 rembert,
100 resnet,
101 retribert,
102 roberta,
103 roformer,
104 segformer,
105 sew,
106 sew_d,
107 speech_encoder_decoder,
108 speech_to_text,
109 speech_to_text_2,
110 splinter,
111 squeezebert,
112 swin,
113 t5,
114 tapas,
115 transfo_xl,
116 trocr,
117 unispeech,
118 unispeech_sat,
119 van,
120 vilt,
121 vision_encoder_decoder,
122 vision_text_dual_encoder,
123 visual_bert,
124 vit,
125 vit_mae,
126 wav2vec2,
127 wav2vec2_phoneme,
128 wav2vec2_with_lm,
129 wavlm,
130 xglm,
131 xlm,
132 xlm_prophetnet,
133 xlm_roberta,
134 xlm_roberta_xl,
135 xlnet,
136 yoso,
137 )
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\models\layoutlm\__init__.py:22
21 from ...utils import _LazyModule, is_tf_available, is_tokenizers_available, is_torch_available
---> 22 from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig
23 from .tokenization_layoutlm import LayoutLMTokenizer
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\models\layoutlm\configuration_layoutlm.py:22
21 from ... import is_torch_available
---> 22 from ...onnx import OnnxConfig, PatchingSpec
23 from ...utils import logging
File <frozen importlib._bootstrap>:1039, in _handle_fromlist(module, fromlist, import_, recursive)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:847, in _LazyModule.__getattr__(self, name)
846 elif name in self._class_to_module.keys():
--> 847 module = self._get_module(self._class_to_module[name])
848 value = getattr(module, name)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:859, in _LazyModule._get_module(self, module_name)
858 except Exception as e:
--> 859 raise RuntimeError(
860 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its traceback):\n{e}"
861 ) from e
RuntimeError: Failed to import transformers.onnx.config because of the following error (look up to see its traceback):
DLL load failed while importing _imaging: The specified module could not be found.
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Cell In[1], line 8
5 import pandas as pd
6 import numpy as np
----> 8 from sentence_transformers import SentenceTransformer
9 from sentence_transformers import SentenceTransformer, util
10 import faiss
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\__init__.py:3
1 __version__ = "2.2.0"
2 __MODEL_HUB_ORGANIZATION__ = 'sentence-transformers'
----> 3 from .datasets import SentencesDataset, ParallelSentencesDataset
4 from .LoggingHandler import LoggingHandler
5 from .SentenceTransformer import SentenceTransformer
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\datasets\__init__.py:3
1 from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset
2 from .NoDuplicatesDataLoader import NoDuplicatesDataLoader
----> 3 from .ParallelSentencesDataset import ParallelSentencesDataset
4 from .SentencesDataset import SentencesDataset
5 from .SentenceLabelDataset import SentenceLabelDataset
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\datasets\ParallelSentencesDataset.py:4
2 import logging
3 import gzip
----> 4 from .. import SentenceTransformer
5 from ..readers import InputExample
6 from typing import List
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\SentenceTransformer.py:27
25 from .evaluation import SentenceEvaluator
26 from .util import import_from_string, batch_to_device, fullname, snapshot_download
---> 27 from .models import Transformer, Pooling, Dense
28 from .model_card_templates import ModelCardTemplate
29 from . import __version__
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\models\__init__.py:1
----> 1 from .Transformer import Transformer
2 from .Asym import Asym
3 from .BoW import BoW
File ~\anaconda3\envs\avatar\lib\site-packages\sentence_transformers\models\Transformer.py:2
1 from torch import nn
----> 2 from transformers import AutoModel, AutoTokenizer, AutoConfig, T5Config
3 import json
4 from typing import List, Dict, Optional, Union, Tuple
File <frozen importlib._bootstrap>:1039, in _handle_fromlist(module, fromlist, import_, recursive)
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:847, in _LazyModule.__getattr__(self, name)
845 value = self._get_module(name)
846 elif name in self._class_to_module.keys():
--> 847 module = self._get_module(self._class_to_module[name])
848 value = getattr(module, name)
849 else:
File ~\anaconda3\envs\avatar\lib\site-packages\transformers\utils\import_utils.py:859, in _LazyModule._get_module(self, module_name)
857 return importlib.import_module("." + module_name, self.__name__)
858 except Exception as e:
--> 859 raise RuntimeError(
860 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its traceback):\n{e}"
861 ) from e
RuntimeError: Failed to import transformers.models.auto because of the following error (look up to see its traceback):
Failed to import transformers.onnx.config because of the following error (look up to see its traceback):
DLL load failed while importing _imaging: The specified module could not be found.