【问题标题】:Python giving illegal instruction(core dumped) error when importing tensorflowPython在导入tensorflow时给出非法指令(核心转储)错误
【发布时间】:2018-03-03 06:27:25
【问题描述】:

我使用的是arch linux并通过pip安装了tensorflow

>>> import tensorflow
[New Thread 0x7ffff29ec700 (LWP 1500)]

Thread 1 "python" received signal SIGILL, Illegal instruction.
0x00007fffe7e93880 in std::pair<std::__detail::_Node_iterator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, false, true>, bool> std::_Hashtable<tensorflow::StringPiece, std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, std::allocator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> > >, std::__detail::_Select1st, std::equal_to<tensorflow::StringPiece>, tensorflow::StringPieceHasher, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_emplace<std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> > >(std::integral_constant<bool, true>, std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> >&&) ()
   from /usr/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so
(gdb) bt
\0  0x00007fffe7e93880 in std::pair<std::__detail::_Node_iterator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, false, true>, bool> std::_Hashtable<tensorflow::StringPiece, std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, std::allocator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> > >, std::__detail::_Select1st, std::equal_to<tensorflow::StringPiece>, tensorflow::StringPieceHasher, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_emplace<std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> > >(std::integral_constant<bool, true>, std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> >&&) ()
   from /usr/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so

【问题讨论】:

  • 您可能应该告诉我们您正在使用什么操作系统(可能还有它的版本),以及您从哪里获得 Python 和 tensorflow(如果它们不是操作系统的标准部分)。
  • 您可能有一个针对与您的 CPU 不同的 CPU 优化的 tensorflow 库(想想 x86 CPU 上的所有向量扩展)。重新计算 tensorflow 或获得“较慢”的版本。
  • 我正在运行arch linux并通过pip安装了tensorflow。 python的版本是3.6.4 @Blckknght

标签: python tensorflow


【解决方案1】:

卸载你的 pip tensorflow 包。

sudo pip uninstall tensorflow

尝试安装官方的tensorflow 包。

sudo pacman -S tensorflow python-tensorflow

稍后,您可以尝试tensorflow-cudapython-tensorflow-cuda

sudo pacman -S tensorflow-cuda python-tensorflow-cuda

【讨论】:

    猜你喜欢
    • 2018-08-11
    • 2020-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-20
    相关资源
    最近更新 更多