yongzhuo / Keras-TextClassification

中文长文本分类、短句子分类、多标签分类、两句子相似度(Chinese Text Classification of Keras NLP, multi-label classify, or sentence classify, long or short),字词句向量嵌入层(embeddings)和网络层(graph)构建基类,FastText,TextCNN,CharCNN,TextRNN, RCNN, DCNN, DPCNN, VDCNN, CRNN, Bert, Xlnet, Albert, Attention, DeepMoji, HAN, 胶囊网络-CapsuleNet, Transformer-encode, Seq2seq, SWEM, LEAM, TextGCN

Home Page:https://blog.csdn.net/rensihui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

xkungfu opened this issue · comments

按以下步骤安装和执行报错

cd /home/datad/pyroot/similartext/Keras-TextClassification

python3 -m pip install --upgrade pip

python3 -m venv env

source ./env/bin/activate

pip3 install --upgrade setuptools

pip3 install tensorflow==1.12.0
pip3 install Keras-TextClassification

cd /home/datad/pyroot/similartextKT/Keras-TextClassification/keras_textclassification/m01_FastText

python train.py

报错信息:

Traceback (most recent call last):
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 31, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 27, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 31, in <module>
    from keras_textclassification.conf.path_config import path_model
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras_textclassification/__init__.py", line 8, in <module>
    from keras_textclassification.text_classification_api import train
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras_textclassification/text_classification_api.py", line 22, in <module>
    from keras_textclassification.m00_Albert.graph import AlbertGraph
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras_textclassification/m00_Albert/graph.py", line 9, in <module>
    from keras.layers import SpatialDropout1D, Conv1D, GlobalMaxPooling1D, Dense
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
    from . import conv_utils
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras/backend/__init__.py", line 89, in <module>
    from .tensorflow_backend import *
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
    import tensorflow as tf
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 31, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/datad/pyroot/similartextKT/env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 27, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

查资料说是cuda未安装或者cuda的版本有问题。

本机:ubuntu18.04, 4核CPU。没有显卡。

pip3 freeze

absl-py==0.11.0
astor==0.8.1
cached-property==1.5.2
certifi==2020.11.8
chardet==3.0.4
gast==0.4.0
gensim==3.8.3
grpcio==1.33.2
h5py==3.1.0
idna==2.10
importlib-metadata==2.0.0
jieba==0.42.1
joblib==0.17.0
Keras==2.2.4
keras-adaptive-softmax==0.6.0
Keras-Applications==1.0.8
keras-bert==0.86.0
keras-embed-sim==0.8.0
keras-layer-normalization==0.14.0
keras-multi-head==0.27.0
keras-pos-embd==0.11.0
keras-position-wise-feed-forward==0.6.0
Keras-Preprocessing==1.1.2
keras-self-attention==0.46.0
Keras-TextClassification==0.1.6
keras-trans-mask==0.4.0
keras-transformer==0.38.0
keras-transformer-xl==0.12.0
keras-xlnet==0.18.0
Markdown==3.3.3
numpy==1.19.4
pandas==1.1.4
passlib==1.7.4
Pillow==8.0.1
pkg-resources==0.0.0
protobuf==3.13.0
python-dateutil==2.8.1
pytz==2020.4
PyYAML==5.3.1
requests==2.24.0
scikit-learn==0.23.2
scipy==1.5.4
sentencepiece==0.1.94
six==1.15.0
smart-open==3.0.0
tensorboard==1.12.2
tensorflow==1.12.0
tensorflow-gpu==1.12.0
termcolor==1.1.0
tflearn==0.3.2
threadpoolctl==2.1.0
tqdm==4.51.0
urllib3==1.25.11
Werkzeug==1.0.1
zipp==3.4.0

重装了一遍不知道为什么没报错了。
步骤变一下。
没执行这个pip3 install --upgrade setuptools
pip3 install Keras-TextClassification
这个放在后面pip3 install tensorflow==1.12.0