3.9CUDA使用过程中的问题

摘要

本文主要是对使用GPU进行数据集的训练中,出现的CUDA水土不服问题进行解决

文中有对具体出现的问题的描述和具体问题的解决方法

  • [x] Edit By Porter, 积水成渊,蛟龙生焉。

一、问题 [libcublas.so.9.0]

1.1 问题描述

  • ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"/home/porter/文档/github workspace/MyKaggle/project/venv/bin/python" "/home/porter/文档/github workspace/MyKaggle/project/cat and dog classiy/dog_cat_class.py"
Using TensorFlow backend.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

1.2 问题解决

  • 步骤一:

在~/.bashrc中添加如下的路径

1
2
3
4
5
6
# add manul configure cuda
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PATH=$PATH:/usr/local/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0

export PATH="$PATH:$HOME/bin"
  • 步骤二:

检查 /usr/local/cuda-9.0/lib64 下是否有 libcublas.so.9.0,没有的话找这个文件链接进去。

如果有,终端输入:

1
sudo ldconfig /usr/local/cuda-9.0/lib64
文章目录
  1. 1. 摘要
    1. 1.1. 一、问题 [libcublas.so.9.0]
      1. 1.1.1. 1.1 问题描述
      2. 1.1.2. 1.2 问题解决
|