美文网首页
ubuntu14.04(64位)安装tensorflow

ubuntu14.04(64位)安装tensorflow

作者: Angel_f4de | 来源:发表于2018-08-02 21:49 被阅读0次

    一:安装pip
    首先下载并安装setuptools:
    前文:tensorflow只支持64位系统!!
    wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
    sudo python ez_setup.py --insecure
    python2.7环境中pip的安装,我是先手动到pip官网下载的最新pip tar文件,然后在主文件夹里解压缩
    cd 解压的文件名之后
    python setup.py install
    安装成功后查看pip版本以作验证:>>pip --version
    二:pip安装cpu版本的tensorflow

    sudo pip tensorflow
    安装过程中提示SIX部分失败,Cannot uninstall ‘six’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
    于是输入>>sudo pip tensorflow --ignore--installed six
    安装成功后在python中导入:
    python
    import tensorflow as tf
    报错,提示非法指令(核心已转存),并导致了python2.7停用的现象,查明是由于cpu版本交老,而上一步安装的是较新的tensorflow-1.9.0造成的不兼容情况。
    解决方法:安装特定版本的tensorflow,
    三:安装特定版本的tensorflow
    先完全卸载原来的高版本的tensorflow:
    sudo pip uninstall protobuf
    sudo pip uninstall tensorflow
    然后安装tensorflow1.5:
    sudo pip install tensorflow==1.5
    最后:
    python
    import tensorflow as tf
    大功告成!

    相关文章

      网友评论

          本文标题:ubuntu14.04(64位)安装tensorflow

          本文链接:https://www.haomeiwen.com/subject/eedsvftx.html