• tensorflow模型量化压缩


    参考 

    https://blog.csdn.net/xygl2009/article/details/80596392

    https://blog.csdn.net/xsfl1234/article/details/67669707

    https://www.jianshu.com/p/d2637646cda1

    1 安装bazel

    https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu

    2 下载tensorflow源码

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

    bazel编译tensoflow源码

    cd tensorflow # cd to the top-level directory created

    ./configure

    bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

    4 利用transform_graph转换模型

    /DATA/share/DeepLearning/code/tensorflow/bazel-bin/tensorflow/tools/graph_transforms/transform_graph
    --in_graph=./model_resnet100.pb
    --out_graph=./model_resnet100modified.pb
    --inputs=input0
    --outputs=fcblock/fc1/add_1
    --transforms='add_default_attributes strip_unused_nodes(type=float, shape="1,112,112,3") remove_nodes(op=Identity, op=CheckNumerics) fold_constants(ignore_errors=true) fold_batch_norms fold_old_batch_norms strip_unused_nodes sort_by_execution_order'

  • 相关阅读:
    (一〇八)iPad开发之横竖屏适配
    ZOJ 1414:Number Steps
    HDU 1391:Number Steps
    ZOJ 1871:Steps
    POJ 2590:Steps
    POJ 2629:Common permutation
    POJ 2562:Primary Arithmetic
    POJ 2505:A multiplication game
    HDU 1517:A Multiplication Game
    POJ 3650:The Seven Percent Solution
  • 原文地址:https://www.cnblogs.com/adong7639/p/9523260.html
Copyright © 2020-2023  润新知