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]

  • 相关阅读:
    HDU 5438 Ponds
    [HNOI2013]比赛
    [HNOI2009]最小圈
    【模板】高斯消元法
    控制公司 Controlling Companies
    sdut 2878 圆圈
    滑雪
    [ZJOI2010]排列计数
    [HNOI2003]激光炸弹
    [BZOJ 3732]Network
  • 原文地址:https://www.cnblogs.com/soildong/p/7225385.html
Copyright © 2011-2022 走看看