You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: Failed to import transformers.models.qwen2_vl.modeling_qwen2_vl because of the following error (look up to see its traceback):
Failed to import transformers.generation.utils because of the following error (look up to see its traceback):
module 'torch.nn' has no attribute 'RMSNorm'
依赖安装都是成功的代码无爆红:
完整错误信息:
Traceback (most recent call last):
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1659, in _get_module
return importlib.import_module("." + module_name, self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\generation\utils.py", line 51, in <module>
from ..pytorch_utils import isin_mps_friendly
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\pytorch_utils.py", line 27, in <module>
ALL_LAYERNORM_LAYERS = [nn.LayerNorm, nn.RMSNorm]
^^^^^^^^^^
AttributeError: module 'torch.nn' has no attribute 'RMSNorm'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1659, in _get_module
return importlib.import_module("." + module_name, self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\models\qwen2_vl\modeling_qwen2_vl.py", line 41, in <module>
from ...modeling_utils import PreTrainedModel
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\modeling_utils.py", line 46, in <module>
from .generation import GenerationConfig, GenerationMixin
File "<frozen importlib._bootstrap>", line 1229, in _handle_fromlist
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1649, in __getattr__
module = self._get_module(self._class_to_module[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1661, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.generation.utils because of the following error (look up to see its traceback):
module 'torch.nn' has no attribute 'RMSNorm'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\A_MyCodingWorkSpace\project\PyCharmProject\Qwen2-vl\Qwen2-VL-2B-Instruct\test.py", line 1, in <module>
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
File "<frozen importlib._bootstrap>", line 1229, in _handle_fromlist
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1650, in __getattr__
value = getattr(module, name)
^^^^^^^^^^^^^^^^^^^^^
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1649, in __getattr__
module = self._get_module(self._class_to_module[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\A_MyCodingWorkSpace\environment\Anaconda3\Anaconda\envs\qwen2_vl\Lib\site-packages\transformers\utils\import_utils.py", line 1661, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.qwen2_vl.modeling_qwen2_vl because of the following error (look up to see its traceback):
Failed to import transformers.generation.utils because of the following error (look up to see its traceback):
module 'torch.nn' has no attribute 'RMSNorm'
The text was updated successfully, but these errors were encountered:
2080ti,Python3.11,transformers 4.45.0.dev0
在运行了:
pip install git+https://github.com/huggingface/transformers accelerate
pip install qwen-vl-utils
后尝试运行示例代码时报错:
依赖安装都是成功的代码无爆红:
完整错误信息:
The text was updated successfully, but these errors were encountered: