【问题标题】:tensorflow on ubuntu 17.10 "artful" failsubuntu 17.10“巧妙”上的 tensorflow 失败
【发布时间】:2018-04-12 20:28:54
【问题描述】:

tensorflow 正在使用 1.6 版,虽然急切执行不起作用,然后我通过pip uninstall tensorflow 卸载了 tensorflow,然后通过pip install tensorflow 安装,我在import tensorflow as tf 上收到指令错误(核心转储)。

注意!我确实在卸载和安装之间巧妙地将 Ubuntu 从 17.xx 升级到了 17.10。

然后我做了pip uninstall tensorflow 然后,从源代码构建了tf(放弃了所有建议的支持而不是jemalloc),之后我得到了:

root@commandor:/opt/tf/sc/tensorflow# python                                                                                                                                        
Python 2.7.14 (default, Sep 23 2017, 22:06:14)                                                                                                                                      
[GCC 7.2.0] on linux2                                                                                                                                                               
Type "help", "copyright", "credits" or "license" for more information.                                                                                                              
>>> import tensorflow                                                                                                                                                               
Traceback (most recent call last):                                                                                                                                                  
  File "<stdin>", line 1, in <module>                                                                                                                                               
  File "tensorflow/__init__.py", line 24, in <module>                                                                                                                               
    from tensorflow.python import *  # pylint: disable=redefined-builtin                                                                                                            
  File "tensorflow/python/__init__.py", line 49, in <module>                                                                                                                        
    from tensorflow.python import pywrap_tensorflow                                                                                                                                 
  File "tensorflow/python/pywrap_tensorflow.py", line 25, in <module>                                                                                                               
    from tensorflow.python.platform import self_check                                                                                                                               
ImportError: No module named platform                                                                                                                                               
>>>   

为什么模块不能识别平台模块?

【问题讨论】:

    标签: python ubuntu tensorflow


    【解决方案1】:

    您尝试在当前工作目录是源所在位置时加载 Tensorflow。

    只需在该目录之外启动 python。

    这是一个已知问题:https://github.com/tensorflow/tensorflow/issues/16264

    【讨论】:

    猜你喜欢
    • 2018-10-07
    • 2018-07-26
    • 2018-04-10
    • 1970-01-01
    • 2018-09-19
    • 2018-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多