zoukankan      html  css  js  c++  java
  • [AI学习] MAC搭建TendorFlow

    1.MAC自带了python2.7

    2.安装pip

      sudo easy_install pip

    3.安装

      sudo easy_install --upgrade six

      sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl

    4.运行出错

      ~ python

      >>>import tensorflow as tf

      报错

      RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9

      ...

      解决

      

    1. brew install python  
    2. brew tap homebrew/science  
    3. brew install opencv 

      不管用,继续查询

      [http://blog.csdn.net/jiangda_0_0/article/details/52608632]

      import numpy

      print numpy.__path__

      在发生错误的Python环境下执行这两个命令,手动删除旧版本的numpy

      直接rm 掉,在运行,ok了。

      

    >>> import tensorflow as tf

    >>> hello = tf.constant('hello tensorflow')

    >>> sess = tf.Session()

    >>> print(sess.run(hello))

    hello tensorflow

    >>> a = tf.constant(10)

    >>> b = tf.constant(32)

    >>> print(sess.run(a+b))

    参考[http://blog.csdn.net/sydpz1987/article/details/51175359]

  • 相关阅读:
    nuc970连接jlink进行单步调试的设置
    alsa utils工具使用
    用arm-linux-gcc v4.3.4交叉编译Qt4.8.3
    LNMP分离式部署
    MHA(下)
    MHA(上)
    PXE自动装机
    JumpServer
    FTP
    DNS
  • 原文地址:https://www.cnblogs.com/soildong/p/7225385.html
Copyright © 2011-2022 走看看