flair erroring out in libcublasLt.so.11 module - nlp

Using flair 0.11.3. Getting below error for from flair.data import Sentence. Not clear on what is causing the issue. It worked on local laptop but running in AzureML Compute instance giving below error. One observation - In local flair did not install nvidia-cuda-runtime-cu11 & other nvidia related packages. Below error seems to be nvidia related packages. Can you please help!
sentencepiece 0.1.97
nvidia-cublas-cu11 11.10.3.66
Error: undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11
from flair.data import Sentence File "/anaconda/envs/honeybee/lib/python3.10/site-packages/flair/__init__.py", line 5, in <module> import torch File "/anaconda/envs/honeybee/lib/python3.10/site-packages/torch/__init__.py", line 191, in <module> _load_global_deps() File "/anaconda/envs/honeybee/lib/python3.10/site-packages/torch/__init__.py", line 153, in _load_global_deps ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) File "/anaconda/envs/honeybee/lib/python3.10/ctypes/__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) OSError: /anaconda/envs/honeybee/lib/python3.10/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11

export LD_LIBRARY_PATH = <path to nvidia cublas/lib/ in conda environment> solved this issue

Related

undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb

I'm getting the error below:
/usr/bin/python3.6 /home/daya/Deep_Learning/Keras-Tuner/HiddenLayersAndHiddenNeurons.py
2020-12-22 09:42:14.472136: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
File "/home/daya/Deep_Learning/Keras-Tuner/HiddenLayersAndHiddenNeurons.py", line 2, in <module>
from tensorflow import keras
File "/home/daya/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 435, in <module>
_ll.load_library(_main_dir)
File "/home/daya/.local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 153, in load_library
py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb
System config:
Ubuntu 18.04,
cuda11.1 cudnn8,
GTX 1660,
Tensorflow-gpu 2.4
In case this is an issue for you and downgrading Tensorflow is not an option, here is a hack:
delete tensorflow/core/kernels/libtfkernel_sobol_op.so altogether. This operator is a special purpose op in classic computer version for edge extraction and for 99.99% of the use cases of TF (training DNN) you won't need this operator.
Looks like it is the following issue (same symbol _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb is missing): https://github.com/tensorflow/text/issues/385
Did you try to update Tensorflow?

Q: How to fix the missing dependancies in pyzbar

I am currently using spyder via anaconda with python 3.8.5 on windows 10 and I am trying to use the pyzbar package to make a barcode reader. When I try to run the script I get this error message when trying to run from pyzbar.pyzbar import decode and from pyzbar import pyzbar:
Traceback (most recent call last):
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 58, in load
dependencies, libzbar = load_objects(Path(''))
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
deps = [
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp>
cdll.LoadLibrary(str(directory.joinpath(dep)))
File "C:\Users\norinhan\Anaconda3\lib\ctypes\__init__.py", line 459, in LoadLibrary
return self._dlltype(name)
File "C:\Users\norinhan\Anaconda3\lib\ctypes\__init__.py", line 381, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<ipython-input-1-95ae0761f4b5>", line 1, in <module>
from pyzbar.pyzbar import decode
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\pyzbar.py", line 7, in <module>
from .wrapper import (
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\wrapper.py", line 139, in <module>
zbar_version = zbar_function(
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\wrapper.py", line 136, in zbar_function
return prototype((fname, load_libzbar()))
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\wrapper.py", line 115, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 60, in load
dependencies, libzbar = load_objects(Path(__file__).parent)
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
deps = [
File "C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp>
cdll.LoadLibrary(str(directory.joinpath(dep)))
File "C:\Users\norinhan\Anaconda3\lib\ctypes\__init__.py", line 459, in LoadLibrary
return self._dlltype(name)
File "C:\Users\norinhan\Anaconda3\lib\ctypes\__init__.py", line 381, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\norinhan\Anaconda3\lib\site-packages\pyzbar\libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
When trying to run just import pyzbar it will compile, but it will not be able to access any of the function. When I try I get this message:
Traceback (most recent call last):
File "<ipython-input-3-26272af93b8a>", line 1, in <module>
pyzbar.pyzbar.decode()
AttributeError: module 'pyzbar' has no attribute 'pyzbar'
I have looked up the documentation for pyzbar on github which states "The zbar DLLs are included with the Windows Python wheels", but have not found this anywhere. The closest to "Windows Python wheels" I have found is the wheel package which does not contain any information about pyzbar.
Any advice on how to fix this?
Visit https://pypi.org/project/pyzbar/#files to download pyzbar-0.1.8-py2.py3-none-win_amd64.whl.
You can find all the DLL files inside the wheel package.
I have just encountered this problem.
If your OS & python are x64 version, it's just because of lack of vc 2013 x64 runtime.
You can find Visual C++ Redistributable Packages for Visual Studio 2013 here
download & install.
I was facing similar issue just installed Visual
C++ 64 bit version on my computer and restarted. Choose between vcredist_x86.exe or vcredist_x64.exe based on your machine.
https://www.microsoft.com/en-us/download/confirmation.aspx?id=40784. Hope this solves your issue as well.

OSError: [WinError 126] while importing seaborn package

I got an example project from my friend that uses seaborn package to draw maps. I've opened project in pycharm, created venv, installed all needed packages and tried to run his code. Unfortunately code returns an error while importing package seaborn:
Traceback (most recent call last):
File "C:/Users/Carlito/Desktop/Maps/map.py", line 6, in <module>
from seaborn import set
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\seaborn\__init__.py", line 6, in <module>
from .rcmod import *
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\seaborn\rcmod.py", line 7, in <module>
from . import palettes, _orig_rc_params
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\seaborn\palettes.py", line 9, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\seaborn\utils.py", line 6, in <module>
from scipy import stats
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "C:\Users\Carlito\Desktop\Maps\venv\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126]
I have tried manually installing all dependencies of this package but it didn't work. These are packages that I've installed:
One maybe important detail, my friend uses Linux Mint, while I am trying to run the project on Windows 10.
Anyone knows what is going on here?
More info required, give this a try
Check for paths hardcoded and try changing to windows backslashes
Example
Here the filepath is given C:/Users/Carlito/Desktop/Maps/map.py, which is Linux , try
Windows
C:\Users\Carlito\Desktop\Maps\map.py
C:\\Users\\Carlito\\Desktop\\Maps\\map.py

Load pkl (using joblib or pickle) generates keyerror 120

I am trying to load a pkl file (in a windows machine) using joblib.
So my code is
from sklearn.externals import joblib
output = joblib.load("file.pkl")
I get this error:
File "cleaning.py", line 97, in <module>
output = joblib.load('file.pkl')
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 459, in load
obj = unpickler.load()
File "C:\Users\me\AppData\Local\Continuum\Anaconda3\lib\pickle.py", line 1039, in load
dispatch[key[0]](self)
KeyError: 120
I tried also using pickle, in this way:
import pickle
with open('file.pkl', 'r') as input:
output = pickle.load(input)
But I got this other error:
File "cleaning.py", line 94, in <module>
output = pickle.load(input)
_pickle.UnpicklingError: invalid load key, 'x'.
Does anyone could help me?
I have already searched on stackoverflow but I didn't find any solution which works for me...
Thanks
Try upgrading scikit-learn to 0.18.1.
pip install scikitlearn==0.18.1
This worked for me after upgrading from the default anaconda version (0.17).

openslide python import show:windows error

I am using python 2.7 win 32
I need to install openslide in python
in below page show
Install openslide
http://openslide.org/download/
which item download for windows.
i tried every thing.and pip installation
the error shows below
import openslide
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import openslide
File "C:\Python27\lib\site-packages\openslide\__init__.py", line 29, in >>>> <module>
from openslide import lowlevel
File "C:\Python27\lib\site-packages\openslide\lowlevel.py", line 41, in <module>
_lib = cdll.LoadLibrary('libopenslide-0.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Thanks
This question may be old, but perhaps an answer will help a future viewer.
To fix this error, you need to download the openslide binaries at http://openslide.org/download/ look under (Windows Binaries)
Next, add the location of the bin folder to your system path (this will allow python to know where the module is). And that should solve the problem.
Install instructions found here: https://pypi.python.org/pypi/openslide-python

Resources