当前位置: 首页 > news >正文

企业信用修复wordpress seo plugin

企业信用修复,wordpress seo plugin,网站设计的公司如何选,php网站插件将Freezed 过的pb文件转成tflite文件#xff0c;并在手机上测试跑分 └── CONTENTS 目录├── 1. 使用Bazel编译转换工具toco├── 2. 用toco转换*.pb模型为*.tflite模型├── 3. [beta] 使用Bazel编译适用于Android的benchmark_model(tflite)工具├── 3. 使用Bazel编…将Freezed 过的pb文件转成tflite文件并在手机上测试跑分 └── CONTENTS 目录├── 1. 使用Bazel编译转换工具toco├── 2. 用toco转换*.pb模型为*.tflite模型├── 3. [beta] 使用Bazel编译适用于Android的benchmark_model(tflite)工具├── 3. 使用Bazel编译适用于Android的benchmark_model(tflite)工具├── 4. adb shell benchmark_model(tflite) 测试tflite模型└── 附录测试及测试结果本机环境Ubuntu 16.04 1. 使用Bazel编译转换工具toco (a) cd到tensorflow目录下也即是换到tensorflow的workspace下 此处依旧以本机环境和目录为例 unaguounaguo:~/backends/tensorflow/$ (b) Bazel编译toco unaguounaguo:~/backends/tensorflow/$ bazel build tensorflow/contrib/lite/toco:toco注意第一个tensorflow是workspace的意思前面不能加./ 2. 用toco转换*.pb模型为*.tflite模型 unaguounaguo:~/backends/tensorflow/$ bazel-bin/tensorflow/contrib/lite/toco/toco \--input_file/YOUR/PATH/TO/PBFILE/source.pb \--input_formatTENSORFLOW_GRAPHDEF \--output_formatTFLITE \--output_file/YOUR/PATH/TO/TFLITEFILE/destination.tflite \--inference_typeFLOAT \--input_typeFLOAT \--input_arraysinput_1 \--output_arraysproba/Sigmoid \--input_shapes1,512,512,3注意上述options中必须要自己修改的如下 OptionsDefinitionsinput_file输入的pb文件名称不需要加“”output_file输出的pb文件名称不需要加“”input_arrays输入节点名称可加可不加“”output_arrays输出节点名称可加可不加“”output_arrays输出节点名称可加可不加“”但是注意名称中带有诸如“:0”的部分要去掉input_shapes输入尺寸 3. [beta] 使用Bazel编译适用于Android的benchmark_model(tflite)工具 依旧在tensorflow的workspace下参照 官方github上的教程 对适用于Android的benchmark_model(tflite)工具 官方上面写的是 bazel build -c opt \--configandroid_arm \--cxxopt--stdc11 \tensorflow/contrib/lite/tools/benchmark:benchmark_model但是很遗憾我这个版本的tensorflow没有专门在~/lite/tools/下专门摘出来的benchmark的文件夹。所以代码改一下 unaguounaguo:~/backends/tensorflow/$ bazel build -c opt \--configandroid_arm \--cxxopt--stdc11 \tensorflow/contrib/lite/tools:benchmark_model把benchmark去掉就行。可以编译 但是很遗憾报错 ERROR: /home/unaguo/backends/tensorflow/tensorflow/core/BUILD:2891:1: C compilation of rule //tensorflow/core:gpu_runtime_impl failed (Exit 1) tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc: In member function virtual void* tensorflow::GPUNanResetAllocator::AllocateRaw(size_t, size_t): tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:176:27: error: nanf is not a member of stdstd::nanf());^ tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc: In member function virtual void tensorflow::GPUNanResetAllocator::DeallocateRaw(void*): tensorflow/core/common_runtime/gpu/gpu_debug_allocator.cc:191:29: error: nanf is not a member of stdstd::nanf());^ Target //tensorflow/contrib/lite/tools:benchmark_model failed to build Use --verbose_failures to see the command lines of failed build steps.那就用 --verbose_failures看一下报错。 ERROR: /home/unaguo/backends/tensorflow/tensorflow/contrib/lite/profiling/BUILD:41:1: C compilation of rule //tensorflow/contrib/lite/profiling:profile_summarizer failed (Exit 1): arm-linux-androideabi-gcc failed: error executing command暂时看不懂。 3. 使用Bazel编译适用于Android的benchmark_model(tflite)工具 经过一个小时的乱操作我编成功了下面记录一下骚操作 (a) 从github上的master分支上的/lite/tools上手动copy下来benchmark文件夹 上文提到我下的版本中没有benchmark文件夹所以我考虑是版本不够新所以决定手动copy下来整个benchmark文件夹。 …1 首先在本地/tensorflow/tensorflow/contrib/lite/tools文件夹下创建叫benchmark的文件夹 …2 然后一个一个拷贝 这个主页下的源码到本地这个benchmark的文件夹下分别是 BUILD benchmark_main.cc benchmark_model.cc benchmark_model.h benchmark_params.cc benchmark_params.h benchmark_tflite_model.cc benchmark_tflite_model.h command_line_flags.cc command_line_flags.h command_line_flags_test.cc logging.h因为我们不做IOS的高端产品所以ios文件夹整个都不拷贝。 …3 README中的那句bazel build代码不求行我参考了tf版 benchmark_model的bazel build unaguounaguo:~/backends/tensorflow/$ bazel build -c opt --crosstool_top//external:android/crosstool --cpuarmeabi-v7a --compilerclang3.8 --host_crosstool_topbazel_tools//tools/cpp:toolchain --cxxopt-stdc11 --config monolithic tensorflow/contrib/lite/tools/benchmark:benchmark_model显示error tensorflow/core/platform/default/logging.cc:65: error: undefined reference to __android_log_write找到tensorflow/core/platform/default/logging.cc:65中这第65行把__android_log_write给他注释掉。 然后再编译 unaguounaguo:~/backends/tensorflow/$ bazel build -c opt --crosstool_top//external:android/crosstool --cpuarmeabi-v7a --compilerclang3.8 --host_crosstool_topbazel_tools//tools/cpp:toolchain --cxxopt-stdc11 --config monolithic tensorflow/contrib/lite/tools/benchmark:benchmark_model然后success。 4. adb shell benchmark_model(tflite) 测试tflite模型 (a) 首先把benchmark_model(tflite)扔进手机中 你们知道我的~/tensorflow目录底下有adb的快捷方式的。 unaguounaguo:~/backends/tensorflow/$ ./adb push bazel-bin/tensorflow/contrib/lite/tools/benchmark/benchmark_model /data/local/tmp(b) 进入adb调试 unaguounaguo:~/backends/tensorflow/$ ./adb shell Z91:/ #© 给/data/local/tmp/benchmark_model开权限 有些手机不开好像也没什么事 Z91:/ # chmod 777 /data/local/tmp/benchmark_model(d) 把tflite模型丢进手机里 unaguounaguo:~/backends/tensorflow$ ./adb push /YOUR/PATH/TO/TFLITEFILE/test.tflite /data/local/tmp(e) 给/data/local/tmp/test.tflite开权限 Z91:/ # chmod 777 /data/local/tmp/test.tflite(f) 测试tflite模型 Z91:/ # /data/local/tmp/benchmark_model \ --graph/data/local/tmp/test.tflite \ --input_layerinput_1 \ --input_layer_shape1,512,512,3 \ --input_layer_typefloat \ --output_layerproba/Sigmoid:0 \ --show_run_orderfalse \ --show_timefalse \ --show_memorytrue \ --show_summarytrue \ --show_flopstrue \ --max_num_runs50output_layer的名称中有没有:0似乎都不会出bug目前我当它没有太大影响 但是这里的input_1如果加上:0就会报错。 几个一定要修改的options OptionsDefinitions--graph模型名称--input_layer输入节点名称--input_layer_shape输入值的尺寸--output_layer输出节点名称 附录测试及测试结果 Num runs: [50] Inter-run delay (seconds): [-1] Num threads: [1] Benchmark name: [] Output prefix: [] Warmup runs: [1] Graph: [./MS512_o1.tflite] Input layers: [input_1] Input shapes: [1,512,512,3] Use nnapi : [0] nnapi error: unable to open library libneuralnetworks.so Loaded model ./MS512_o1.tflite resolved reporter Initialized session in 82.668ms Running benchmark for 1 iterations count1 curr1303963Running benchmark for 50 iterations count50 first1260477 curr1259469 min1255535 max1261653 avg1.25879e06 std1188Average inference timings in us: Warmup: 1.30396e06, Init: 82668, no stats: 1.25879e06结论TODO
http://www.hkea.cn/news/14457725/

相关文章:

  • 网站建设是用自己的服务器wordpress 好的相册
  • 网站大图片优化设计的软件都有什么
  • 企业网站设计期末考试生产管理
  • 网站建设流程表佛山网站建设流程
  • 酒店宾馆型网站开发广州软件开发工资一般多少
  • 柳州网站建设11桐庐营销型网站建设
  • 公司网站开发方案建设厅官方网站企业库
  • 成都网站设计平台互联网广告行业
  • 广州番禺区网站建设陕西关键词优化推荐
  • 帝国cms 网站地图标签c2c定义
  • jQuery EasyUI网站开发实战口碑好网站建设报价
  • 网站建设自己怎么做青岛网站推广途径
  • 宁波网站建站WordPress手动切换主题
  • 请人做网站收费多少网站开发 石家庄
  • 不用下载的游戏直接玩扬州抖音seo
  • 做服装有哪些好的网站有哪些方面漯河百度做网站电话
  • 汕头网站建设方案优化建网站代理
  • 物流网站建设公司餐饮业网站源码 织梦
  • 常州网站搜索优化设计师培训感悟
  • 购物网站英文介绍企业年度申报网上申报
  • 网站无法发送邮件wordpress中搜seo
  • 怎么样做移动油光文字网站开商城网站多少钱
  • 新闻wordpress主题河西网站建设优化seo
  • 网站建设泉州效率网络电商类网站
  • 长春专业网站建设价格中英文网站建设企业
  • c 网站开发引擎流程图在线制作工具
  • 好的响应式网站有哪些手机建立网站的软件
  • Iis 建网站为什么说没有该用户工商局网站如何做网登
  • 网站密码管理制度做网站需要收付款功能吗
  • python3 做网站做网站工作室找客户难