参考 

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'

 

相关文章:

  • 2021-12-26
  • 2021-12-03
  • 2022-01-07
  • 2021-05-13
  • 2021-06-06
  • 2021-06-13
  • 2021-07-09
  • 2021-07-26
猜你喜欢
  • 2022-12-23
  • 2021-10-21
  • 2021-12-13
  • 2021-10-03
  • 2021-12-01
  • 2021-09-17
相关资源
相似解决方案