New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question about example.cc #11
Comments
可以直接使用 |
@yejw5 |
|
starqltecmcc:/data/local/tmp/mace_test $ ./test_mace logcat ...
|
代码里面有一行 |
我也很奇怪这个日志打印,当把 CreateMaceEngineFromCode 注释掉,就OK,printf也有。 |
把手动编译的命令给一下 |
@yejw5 |
demo_app_models.yaml 能发一下吗?你用的哪一个? |
CreateMaceEngineFromCode 和 CreateMaceEngineFromProto只能用一个,用哪个取决于你使用的哪种build方式。 |
@llhe |
你能把你的代码用markdown的代码块引用一下吗,前面你贴的格式/内容都错了?或者直接把源文件贴上来。 |
帮你调整了一下。 |
@huanyingjun 或者你把整个项目打包上传一下。 |
@huanyingjun |
@llhe |
@huanyingjun 还是等你网络好了上传了这个文件我们再看下吧,这个依赖MACE本身也不依赖(最多是依赖lite而不是full,且不是动态库) |
@huanyingjun 抱歉,我在本地测试了你的代码,报了一样的错误。猜想是静态库里面带的protobuf符号,与系统的protobuf冲突导致的,但是ndk-build我这边之前没使用过,没找到strip的命令,如果你那边了解这一块,可以试着将所有的符号strip掉,猜测应该能够避免这个报错 |
@huanyingjun 这边确认把mace相关的符号strip掉之后,运行成功了。在
|
附root cause分析:
|
python tools/converter.py build --config=docs/getting_started/models/demo_app_models.yaml
运行后生成如下文件:
├── include
│ └── mace
│ └── public
│ ├── mace_engine_factory.h
│ ├── mace.h
│ ├── mace_runtime.h
│ ├── mobilenet_v1.h
│ └── mobilenet_v2.h
├── lib
│ └── arm64-v8a
│ └── libmace_mobilenet.a
├── libmace_mobilenet.tar.gz
├── model
└── _tmp
├── arm64-v8a_e2a4c8972fefd2c3d18824a4b1c58ed9
│ ├── benchmark_model_static
│ └── mace_run_static
├── mobilenet_v1
│ └── f330dec17e45a8626cfb225ddce95051
│ ├── general
│ │ └── arm64-v8a
│ │ └── model_input_input
│ └── model.pb
└── mobilenet_v2
└── d4e627ce1b15ed6f96aefffe315a8dc8
├── general
│ └── arm64-v8a
│ └── model_input_input
└── model.pb
按照这个转换模型之后,example.cc 中有几个参数不知道怎么设置:
FLAGS_opencl_binary_file 这个是什么?
CreateMaceEngineFromProto 和 CreateMaceEngineFromCode 只需要调其中的一个就行了吧?
FLAGS_model_name 是 demo_app_models.yaml中的 mobilenet_v1 或者 mobilenet_v2?
调用 CreateMaceEngineFromCode 的时候,第二个参数 FLAGS_model_data_file 直接设NULL ?
我参考example.cc写了个test文件,用ndk独立编译(不放在mace用bazel编译)
除了要链接 libmace_mobilenet.a ,还需要链接什么别的库吗?
非常感谢
The text was updated successfully, but these errors were encountered: