visual-chatgpt
visual-chatgpt copied to clipboard
Failed to import transformers
RuntimeError: Failed to import transformers.models.clipseg.modeling_clipseg because of the following error (look up to see its traceback): /usr/local/lib/python3.8/dist-packages/transformer_engine_extensions.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops5zeros4callEN3c108ArrayRefINS2_6SymIntEEENS2_8optionalINS2_10ScalarTypeEEENS6_INS2_6LayoutEEENS6_INS2_6DeviceEEENS6_IbEE
The error message you're seeing suggests that there is an issue with the transformers package in your Python environment. Specifically, it seems that there may be a problem with the transformer_engine_extensions.cpython-38-x86_64-linux-gnu.so module, which is failing to import the transformers.models.clipseg.modeling_clipseg module.
I am having the same error
transformers 4.29.2 python 3.9
Hi, I solved this by pip uninstall transformer-engine
I got the same problem. python 3.10.12 transformers 4.27.1 or 4.30.2
Anyone found out why this happens?
I have the same problem.
me too
python 3.10 transformers 4.28
File /usr/local/lib/python3.10/dist-packages/transformer_engine/pytorch/cpp_extensions/__init__.py:6
1 # Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2 #
3 # See LICENSE for license information.
5 """Python interface for c++ extensions"""
----> 6 from transformer_engine_extensions import *
8 from .fused_attn import *
9 from .gemm import *
ImportError: /usr/local/lib/python3.10/dist-packages/transformer_engine_extensions.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Anyone found out why this happens?
The reason seem obvious
>>> import torch
>>> torch.compiled_with_cxx11_abi()
False
>>> torch.__version__
'2.1.0+cu121'
Community pytorch is always compiled and released with -D_GLIBCXX_USE_CXX11_ABI=0
However transformer_engine_extensions
is compiled and released with -D_GLIBCXX_USE_CXX11_ABI=1
thus it's looking for a symbol with CXX11 ABI -- torch::jit::parseSchemaOrName(std::__cxx11::basic_string<char, std::char_traits
I guess nvidia compiles everything with -D_GLIBCXX_USE_CXX11_ABI=1
within the NGC docker so they could work along.
But if you install pytorch from pip install then boooooom.
Hi, I solved this by pip uninstall transformer-engine
感谢!我也是这么解决的
Hi, I solved this by pip uninstall transformer-engine
Hi, I solved this by pip uninstall transformer-engine
thanks, this work for me!
my error:
transformer_engine_extensions.cpython-38-x86_64-linux-gnu.so: undefined symbol
Anyone found out why this happens?
The reason seem obvious
>>> import torch >>> torch.compiled_with_cxx11_abi() False >>> torch.__version__ '2.1.0+cu121'
Community pytorch is always compiled and released with
-D_GLIBCXX_USE_CXX11_ABI=0
However
transformer_engine_extensions
is compiled and released with-D_GLIBCXX_USE_CXX11_ABI=1
thus it's looking for a symbol with CXX11 ABI -- torch::jit::parseSchemaOrName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)I guess nvidia compiles everything with
-D_GLIBCXX_USE_CXX11_ABI=1
within the NGC docker so they could work along.But if you install pytorch from pip install then boooooom.
@kevint324 hi, thanks for your answer! any solutions to this instead of uninstall transformer_engine? how should we pip install torch?
Anyone found out why this happens?
The reason seem obvious
>>> import torch >>> torch.compiled_with_cxx11_abi() False >>> torch.__version__ '2.1.0+cu121'
Community pytorch is always compiled and released with
-D_GLIBCXX_USE_CXX11_ABI=0
Howevertransformer_engine_extensions
is compiled and released with-D_GLIBCXX_USE_CXX11_ABI=1
thus it's looking for a symbol with CXX11 ABI -- torch::jit::parseSchemaOrName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) I guess nvidia compiles everything with-D_GLIBCXX_USE_CXX11_ABI=1
within the NGC docker so they could work along. But if you install pytorch from pip install then boooooom.@kevint324 hi, thanks for your answer! any solutions to this instead of uninstall transformer_engine? how should we pip install torch?
Do NOT install torch from pip. Just pull any ngc docker and use the pytorch out of the box.
I managed to solve it after this:
pip uninstall transformers-y
And then install the transformers:
pip install transformers
Got:
import transformers transformers.__version__
:
4.38.0.dev0
pip uninstall transformer-engine then, pip install transformers
Got new error for pipeline how to rectify this :
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback): /usr/local/lib/python3.10/dist-packages/transformer_engine_extensions.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Hi, I solved this by pip uninstall transformer-engine
Me too. Thanks a lot!
Hi, I solved this by pip uninstall transformer-engine
pip uninstall transformer-engine then, pip install transformers
Got permission error for pip uninstall transformer-engine then, pip install transformers
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/libtransformer_engine.so'
Got permission error for pip uninstall transformer-engine then, pip install transformers
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/libtransformer_engine.so'
The folder you are trying to install it to does not have permissions.
you should ideally create a virtual env and install there. If not install as super user using sudo.
Hi, I solved this by pip uninstall transformer-engine
nice! it works
Hi, I solved this by pip uninstall transformer-engine
完美,困扰我好久了,终于解决了
Hi, I solved this by pip uninstall transformer-engine
完美,困扰我好久了,终于解决了
不用谢😁
I got the same problem. And in my situation, it may because of the confliction between transformer-engine and accelerate library. So uninstalling one of them would solve it.
uninstall transormer_engine works. For me this problem occured when I tried to import groundingdino, which uses transformers. It may be because my superior upgraded pytorch in the image after installed the requirements.