我已经使用Tensorflow进行了几个月的编程,但现在当我尝试导入它的包时,我得到了一个Segmentation错误,如下所示:
> ipython3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import tensorflow
Segmentation fault (core dumped)
>
我在运行gdb时重现了这个问题。为此,我编写了一个只有这一行的程序main.py
:
import tensorflow
然后我在gdb下运行python3 main.py
;底部错误:
> gdb --args python3 main.py
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/python3 main.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff36fc700 (LWP 4057)]
[New Thread 0x7ffff2efb700 (LWP 4058)]
[New Thread 0x7fffee6fa700 (LWP 4059)]
[New Thread 0x7fffebef9700 (LWP 4060)]
[New Thread 0x7fffe96f8700 (LWP 4061)]
[New Thread 0x7fffe6ef7700 (LWP 4062)]
[New Thread 0x7fffe46f6700 (LWP 4063)]
[Thread 0x7fffe46f6700 (LWP 4063) exited]
[Thread 0x7fffe6ef7700 (LWP 4062) exited]
[Thread 0x7fffe96f8700 (LWP 4061) exited]
[Thread 0x7fffebef9700 (LWP 4060) exited]
[Thread 0x7fffee6fa700 (LWP 4059) exited]
[Thread 0x7ffff2efb700 (LWP 4058) exited]
[Thread 0x7ffff36fc700 (LWP 4057) exited]
Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb)
知道问题可能是什么,或者我可以收集哪些其他信息来排除故障?我的猜测是我最近安装的,但无法想到具体的东西。这里有一些相关的环境变量:
CUDA_HOME=/usr/local/cuda
LD_LIBRARY_PATH=/usr/local/lib/cuda/lib64:/usr/local/cuda-8.0/lib64
请注意,在导入Tensorflow软件包时,即使在尝试打开CUDA库之前,问题就会立即发生,这与this other issue不同。
我正在运行Python 3.5.2,所有已安装的软件包都更新到最新版本,包括在Ubuntu 16.04下的tensorflow-gpu(1.1.0)。
谢谢!
更新:这是gdb bt
(gdb) bt
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x000000000054a7c4 in PyUnicode_FromFormatV ()
#2 0x00000000005bbe63 in PyErr_FormatV ()
#3 0x00000000005bbf24 in PyErr_Format ()
#4 0x00007fffb462266b in sip_api_export_module () from /usr/local/lib/python3.5/dist-packages/sip.so
#5 0x00007fffb851ff37 in PyInit_QtGui () from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-35m-x86_64-linux-gnu.so
#6 0x000000000060605e in _PyImport_LoadDynamicModuleWithSpec ()
#7 0x0000000000606618 in ?? ()
#8 0x00000000004e9c56 in PyCFunction_Call ()
#9 0x000000000052ad74 in PyEval_EvalFrameEx ()
#10 0x000000000052d2e3 in ?? ()
#11 0x0000000000529332 in PyEval_EvalFrameEx ()
#12 0x0000000000528814 in PyEval_EvalFrameEx ()
#13 0x0000000000528814 in PyEval_EvalFrameEx ()
#14 0x0000000000528814 in PyEval_EvalFrameEx ()
#15 0x0000000000528814 in PyEval_EvalFrameEx ()
#16 0x000000000052e12b in PyEval_EvalCodeEx ()
#17 0x00000000004ebcc3 in ?? ()
#18 0x00000000005b7167 in PyObject_Call ()
#19 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#20 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#21 0x00000000005c7688 in ?? ()
#22 0x00000000004e9bc7 in PyCFunction_Call ()
#23 0x00000000005b7167 in PyObject_Call ()
#24 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#25 0x0000000000526fbc in PyEval_EvalFrameEx ()
#26 0x000000000052d82f in ?? ()
#27 0x0000000000529332 in PyEval_EvalFrameEx ()
#28 0x0000000000528814 in PyEval_EvalFrameEx ()
#29 0x000000000052d2e3 in ?? ()
#30 0x000000000052dfdf in PyEval_EvalCode ()
#31 0x00000000005c7a78 in ?? ()
#32 0x00000000004e9c56 in PyCFunction_Call ()
#33 0x000000000052ad74 in PyEval_EvalFrameEx ()
#34 0x000000000052d2e3 in ?? ()
#35 0x0000000000529332 in PyEval_EvalFrameEx ()
#36 0x0000000000528814 in PyEval_EvalFrameEx ()
#37 0x0000000000528814 in PyEval_EvalFrameEx ()
#38 0x0000000000528814 in PyEval_EvalFrameEx ()
#39 0x000000000052e12b in PyEval_EvalCodeEx ()
#40 0x00000000004ebcc3 in ?? ()
#41 0x00000000005b7167 in PyObject_Call ()
#42 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#43 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#44 0x00000000005c7688 in ?? ()
#45 0x00000000004e9bc7 in PyCFunction_Call ()
#46 0x000000000052ad74 in PyEval_EvalFrameEx ()
#47 0x000000000052d2e3 in ?? ()
#48 0x0000000000529332 in PyEval_EvalFrameEx ()
#49 0x0000000000528814 in PyEval_EvalFrameEx ()
#50 0x000000000052e12b in PyEval_EvalCodeEx ()
#51 0x00000000004ebcc3 in ?? ()
#52 0x00000000005b7167 in PyObject_Call ()
#53 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#54 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#55 0x00000000005c7688 in ?? ()
#56 0x00000000004e9bc7 in PyCFunction_Call ()
#57 0x00000000005b7167 in PyObject_Call ()
#58 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#59 0x0000000000526fbc in PyEval_EvalFrameEx ()
#60 0x000000000052d2e3 in ?? ()
#61 0x000000000052dfdf in PyEval_EvalCode ()
#62 0x00000000005c7a78 in ?? ()
#63 0x00000000004e9c56 in PyCFunction_Call ()
#64 0x000000000052ad74 in PyEval_EvalFrameEx ()
#65 0x000000000052d2e3 in ?? ()
#66 0x0000000000529332 in PyEval_EvalFrameEx ()
#67 0x0000000000528814 in PyEval_EvalFrameEx ()
#68 0x0000000000528814 in PyEval_EvalFrameEx ()
#69 0x0000000000528814 in PyEval_EvalFrameEx ()
#70 0x000000000052e12b in PyEval_EvalCodeEx ()
#71 0x00000000004ebcc3 in ?? ()
#72 0x00000000005b7167 in PyObject_Call ()
#73 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#74 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#75 0x00000000005c7688 in ?? ()
#76 0x00000000004e9bc7 in PyCFunction_Call ()
#77 0x00000000005b7167 in PyObject_Call ()
#78 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#79 0x0000000000526fbc in PyEval_EvalFrameEx ()
#80 0x000000000052d2e3 in ?? ()
#81 0x000000000052dfdf in PyEval_EvalCode ()
#82 0x00000000005c7a78 in ?? ()
#83 0x00000000004e9c56 in PyCFunction_Call ()
#84 0x000000000052ad74 in PyEval_EvalFrameEx ()
#85 0x000000000052d2e3 in ?? ()
#86 0x0000000000529332 in PyEval_EvalFrameEx ()
#87 0x0000000000528814 in PyEval_EvalFrameEx ()
#88 0x0000000000528814 in PyEval_EvalFrameEx ()
#89 0x0000000000528814 in PyEval_EvalFrameEx ()
#90 0x000000000052e12b in PyEval_EvalCodeEx ()
---Type <return> to continue, or q <return> to quit---
#91 0x00000000004ebcc3 in ?? ()
#92 0x00000000005b7167 in PyObject_Call ()
#93 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#94 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#95 0x00000000005c7688 in ?? ()
#96 0x00000000004e9bc7 in PyCFunction_Call ()
#97 0x00000000005b7167 in PyObject_Call ()
#98 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#99 0x0000000000526fbc in PyEval_EvalFrameEx ()
#100 0x000000000052d2e3 in ?? ()
#101 0x000000000052dfdf in PyEval_EvalCode ()
#102 0x00000000005c7a78 in ?? ()
#103 0x00000000004e9c56 in PyCFunction_Call ()
#104 0x000000000052ad74 in PyEval_EvalFrameEx ()
#105 0x000000000052d2e3 in ?? ()
#106 0x0000000000529332 in PyEval_EvalFrameEx ()
#107 0x0000000000528814 in PyEval_EvalFrameEx ()
#108 0x0000000000528814 in PyEval_EvalFrameEx ()
#109 0x0000000000528814 in PyEval_EvalFrameEx ()
#110 0x000000000052e12b in PyEval_EvalCodeEx ()
#111 0x00000000004ebcc3 in ?? ()
#112 0x00000000005b7167 in PyObject_Call ()
#113 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#114 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#115 0x00000000005c7688 in ?? ()
#116 0x00000000004e9bc7 in PyCFunction_Call ()
#117 0x000000000052ad74 in PyEval_EvalFrameEx ()
#118 0x000000000052d2e3 in ?? ()
#119 0x0000000000529332 in PyEval_EvalFrameEx ()
#120 0x000000000052e12b in PyEval_EvalCodeEx ()
#121 0x00000000004ebcc3 in ?? ()
#122 0x00000000005b7167 in PyObject_Call ()
#123 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#124 0x000000000051ba66 in PyImport_ImportModuleLevelObject ()
#125 0x00000000005c7688 in ?? ()
#126 0x00000000004e9bc7 in PyCFunction_Call ()
#127 0x00000000005b7167 in PyObject_Call ()
#128 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#129 0x0000000000526fbc in PyEval_EvalFrameEx ()
#130 0x000000000052d2e3 in ?? ()
#131 0x000000000052dfdf in PyEval_EvalCode ()
#132 0x00000000005c7a78 in ?? ()
#133 0x00000000004e9c56 in PyCFunction_Call ()
#134 0x000000000052ad74 in PyEval_EvalFrameEx ()
#135 0x000000000052d2e3 in ?? ()
#136 0x0000000000529332 in PyEval_EvalFrameEx ()
#137 0x0000000000528814 in PyEval_EvalFrameEx ()
#138 0x0000000000528814 in PyEval_EvalFrameEx ()
#139 0x0000000000528814 in PyEval_EvalFrameEx ()
#140 0x000000000052e12b in PyEval_EvalCodeEx ()
#141 0x00000000004ebcc3 in ?? ()
#142 0x00000000005b7167 in PyObject_Call ()
#143 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#144 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#145 0x00000000005c7688 in ?? ()
#146 0x00000000004e9bc7 in PyCFunction_Call ()
#147 0x00000000005b7167 in PyObject_Call ()
#148 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#149 0x0000000000526fbc in PyEval_EvalFrameEx ()
#150 0x000000000052d2e3 in ?? ()
#151 0x000000000052dfdf in PyEval_EvalCode ()
#152 0x00000000005c7a78 in ?? ()
#153 0x00000000004e9c56 in PyCFunction_Call ()
#154 0x000000000052ad74 in PyEval_EvalFrameEx ()
#155 0x000000000052d2e3 in ?? ()
#156 0x0000000000529332 in PyEval_EvalFrameEx ()
#157 0x0000000000528814 in PyEval_EvalFrameEx ()
#158 0x0000000000528814 in PyEval_EvalFrameEx ()
#159 0x0000000000528814 in PyEval_EvalFrameEx ()
#160 0x000000000052e12b in PyEval_EvalCodeEx ()
#161 0x00000000004ebcc3 in ?? ()
#162 0x00000000005b7167 in PyObject_Call ()
#163 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#164 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#165 0x00000000005c7688 in ?? ()
#166 0x00000000004e9bc7 in PyCFunction_Call ()
#167 0x000000000052ad74 in PyEval_EvalFrameEx ()
#168 0x000000000052d2e3 in ?? ()
#169 0x0000000000529332 in PyEval_EvalFrameEx ()
#170 0x000000000052e12b in PyEval_EvalCodeEx ()
#171 0x00000000004ebcc3 in ?? ()
#172 0x00000000005b7167 in PyObject_Call ()
#173 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#174 0x000000000051ba66 in PyImport_ImportModuleLevelObject ()
#175 0x00000000005c7688 in ?? ()
#176 0x00000000004e9bc7 in PyCFunction_Call ()
#177 0x00000000005b7167 in PyObject_Call ()
#178 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#179 0x0000000000526fbc in PyEval_EvalFrameEx ()
#180 0x000000000052d2e3 in ?? ()
#181 0x000000000052dfdf in PyEval_EvalCode ()
---Type <return> to continue, or q <return> to quit---
#182 0x00000000005c7a78 in ?? ()
#183 0x00000000004e9c56 in PyCFunction_Call ()
#184 0x000000000052ad74 in PyEval_EvalFrameEx ()
#185 0x000000000052d2e3 in ?? ()
#186 0x0000000000529332 in PyEval_EvalFrameEx ()
#187 0x0000000000528814 in PyEval_EvalFrameEx ()
#188 0x0000000000528814 in PyEval_EvalFrameEx ()
#189 0x0000000000528814 in PyEval_EvalFrameEx ()
#190 0x000000000052e12b in PyEval_EvalCodeEx ()
#191 0x00000000004ebcc3 in ?? ()
#192 0x00000000005b7167 in PyObject_Call ()
#193 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#194 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#195 0x00000000005c7688 in ?? ()
#196 0x00000000004e9bc7 in PyCFunction_Call ()
#197 0x000000000052ad74 in PyEval_EvalFrameEx ()
#198 0x000000000052d2e3 in ?? ()
#199 0x0000000000529332 in PyEval_EvalFrameEx ()
#200 0x000000000052e12b in PyEval_EvalCodeEx ()
#201 0x00000000004ebcc3 in ?? ()
#202 0x00000000005b7167 in PyObject_Call ()
#203 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#204 0x000000000051ba66 in PyImport_ImportModuleLevelObject ()
#205 0x00000000005c7688 in ?? ()
#206 0x00000000004e9bc7 in PyCFunction_Call ()
#207 0x00000000005b7167 in PyObject_Call ()
#208 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#209 0x0000000000526fbc in PyEval_EvalFrameEx ()
#210 0x000000000052d2e3 in ?? ()
#211 0x000000000052dfdf in PyEval_EvalCode ()
#212 0x00000000005c7a78 in ?? ()
#213 0x00000000004e9c56 in PyCFunction_Call ()
#214 0x000000000052ad74 in PyEval_EvalFrameEx ()
#215 0x000000000052d2e3 in ?? ()
#216 0x0000000000529332 in PyEval_EvalFrameEx ()
#217 0x0000000000528814 in PyEval_EvalFrameEx ()
#218 0x0000000000528814 in PyEval_EvalFrameEx ()
#219 0x0000000000528814 in PyEval_EvalFrameEx ()
#220 0x000000000052e12b in PyEval_EvalCodeEx ()
#221 0x00000000004ebcc3 in ?? ()
#222 0x00000000005b7167 in PyObject_Call ()
#223 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#224 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#225 0x00000000005c7688 in ?? ()
#226 0x00000000004e9bc7 in PyCFunction_Call ()
#227 0x00000000005b7167 in PyObject_Call ()
#228 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#229 0x0000000000526fbc in PyEval_EvalFrameEx ()
#230 0x000000000052d2e3 in ?? ()
#231 0x000000000052dfdf in PyEval_EvalCode ()
#232 0x00000000005c7a78 in ?? ()
#233 0x00000000004e9c56 in PyCFunction_Call ()
#234 0x000000000052ad74 in PyEval_EvalFrameEx ()
#235 0x000000000052d2e3 in ?? ()
#236 0x0000000000529332 in PyEval_EvalFrameEx ()
#237 0x0000000000528814 in PyEval_EvalFrameEx ()
#238 0x0000000000528814 in PyEval_EvalFrameEx ()
#239 0x0000000000528814 in PyEval_EvalFrameEx ()
#240 0x000000000052e12b in PyEval_EvalCodeEx ()
#241 0x00000000004ebcc3 in ?? ()
#242 0x00000000005b7167 in PyObject_Call ()
#243 0x00000000005b7f8a in _PyObject_CallMethodIdObjArgs ()
#244 0x000000000051ba98 in PyImport_ImportModuleLevelObject ()
#245 0x00000000005c7688 in ?? ()
#246 0x00000000004e9bc7 in PyCFunction_Call ()
#247 0x00000000005b7167 in PyObject_Call ()
#248 0x0000000000523800 in PyEval_CallObjectWithKeywords ()
#249 0x0000000000526fbc in PyEval_EvalFrameEx ()
#250 0x000000000052d2e3 in ?? ()
#251 0x000000000052dfdf in PyEval_EvalCode ()
#252 0x00000000005fd2c2 in ?? ()
#253 0x00000000005ff76a in PyRun_FileExFlags ()
#254 0x00000000005ff95c in PyRun_SimpleFileExFlags ()
#255 0x000000000063e7d6 in Py_Main ()
#256 0x00000000004cfe41 in main ()