zoukankan      html  css  js  c++  java
  • tensorflow移植到ios

    1.git clone到本地

    git clone https://github.com/tensorflow/tensorflowxcode

    2.compile static library 

    安装xcode command line: xcode-select --install

    安装依赖包: brew install automake brew install libtool

    安装automake时,autoconf下载失败,自己编译安装.
    cd autoconf-2.65
    ./configure --prefix=/usr/local  
    make
    sudo make install
    autoconf -V
    
    autoconf编译安装后,brew依然卡在下载autoconf.
    参考:http://blog.csdn.net/x32sky/article/details/42710063 同样自己编译安装和libtool
    automake --version

    下载graph:

    mkdir -p ~/graphs
    
    curl -o ~/graphs/inception.zip https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip 
    
    unzip ~/graphs/inception.zip -d ~/graphs/inception

    使用curl下载太慢,直接输入网址下载,解压后文件夹改名为inception.

    3.一键编译

    tensorflow/contrib/makefile/build_all_ios.sh
    下载dependencies时可能比较慢,等等就好。也可以自己下载后放到tensorflow/contrib/makefile/downloads下,
    各目录名字为eigen、gemmlowp、googletest、protobuf、re2

    最终在 tensorflow/contrib/makefile/gen/lib/ 下生成.a文件

     

     

    TensorFlow iOS Examples流程

    1.~/graphs/inception已经下好,copy到ios_examples

    cp ~/graphs/inception/* tensorflow/contrib/ios_examples/benchmark/data/
    cp ~/graphs/inception/* tensorflow/contrib/ios_examples/camera/data/
    cp ~/graphs/inception/* tensorflow/contrib/ios_examples/simple/data/

    打开xcode工程编译运行即可。。。 

  • 相关阅读:
    MySQL之权限管理
    CentOS7使用firewalld打开关闭防火墙与端口
    CentOS 7.2 基于Docker实现MySQL主从架构
    Centos7下安装Docker
    nginx php-fpm安装配置 CentOS编译安装php7.2
    php7的扩展库安装方法
    Android 程序打包及签名
    Message和handler传递对象
    Android AlertDialog去除黑边白边自定义布局(转)
    用MVC做支付宝手机网页支付问题
  • 原文地址:https://www.cnblogs.com/mlj318/p/6434924.html
Copyright © 2011-2022 走看看