Open iamjoseph331 opened 1 year ago
You can try to compile the model conversion tool, and then convert the model.
The converter was successfully compiled and also successfully converted my model, I think.
The command I used: python3 onnx2tnn.py -o ~/ml/models/pose -version=v3.0 ~/ml/models/pose/v1/cloud/PoseV1-1227x1.onnx
Logs: https://pastebin.com/Fvz0YpvW However I still face an old problem
E virtual tnn::Status tnn::ArmLayerAcc::RawBuffer2ArmBlob(tnn::RawBuffer , std::shared_ptr
which claims that I am using the data type unsigned int for the buffer stated here: https://github.com/Tencent/TNN/blob/c6030afea8f85c189fd79ccc04ce684fa73f1f56/source/tnn/device/arm/acc/arm_layer_acc.cc#L135
After simplified my onnx model I got the same problem as before:
Any help would be appreciated.
python converter.py onnx2tnn -align=output -optimize /the/path/to/PoseV1-1227x1.onnx
D/tnn: CheckResult [File test/test.cc][Line 341] create instance success!
D/tnn: CheckResult [File test/test.cc][Line 341] ConvertFromMat success!
D/tnn: CheckResult [File test/test.cc][Line 341] Forward success!
D/tnn: CheckResult [File test/test.cc][Line 341] ConvertToMat success!
I/tnn: Print [File test/timer.cc][Line 60] PoseV1-1227x1.opt.tnnproto - ARM TNN Benchmark time cost: min = 49.340 ms | max = 49.340 ms
@gttiankai I recompiled TNN and convert2tnn tools in my x86_64 Linux machine.
Using the above command, I am able to convert the model and align it with no problem.
However in my TNNtest output I didn't receive the same results with yours.
I found out that when building the converter the ARM argument wasn't activated. In the code it looks like this is only for debug usage. I tried again with -DTNN_ARM_ENABLE="ON"
, but it also didn't work.
I am running TNN from the master branch and compiled it on linux_native with ARM enabled. The converted outcome is here: tnnproto tnnmodel
1. 环境(environment)
RunTime DEVICE: ARM
2. Github版本
commit(optional):
3. 编译方式(compile method) CMake完整编译参数(full cmake arguments)
4. 编译日志(build log) 将日志粘贴在这里 pastebin
**** step 1: update version.h **** /Users/joseph/Projects/Mobile/TNN/scripts/version rm: /Users/joseph/Projects/Mobile/TNN/scripts/version/version.h: No such file or directory rm: -f: No such file or directory Target: tnn Commit Branch: master Commit Date: 2022-12-21 Commit Hash: 35690301 rm: -f: No such file or directory
**** step 2: start build rpn arm32 **** remove build32 armeabi-v7a -- android-14 is unsupported. Using minimum supported version 16. -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang /Users/joseph/Projects/Mobile/TNN /Users/joseph/Projects/Mobile/TNN -- Found OpenMP_C: -fopenmp=libomp (found version "3.1") -- Found OpenMP_CXX: -fopenmp=libomp (found version "3.1") -- Found OpenMP: TRUE (found version "3.1")
-- >>>>>>>>>>>>> -- TNN BUILD INFO: -- System: Android -- Processor: armv7-a -- Cpu: ON -- X86: OFF -- Arm: ON -- Arm82: ON -- Metal: OFF -- OpenCL: ON -- CUDA: OFF -- DSP: OFF -- Atlas: OFF -- TensorRT: OFF -- AppleNPU: OFF -- HuaweiNPU: OFF -- RKNPU: OFF -- Jetson Nano: OFF -- OpenVINO: OFF -- OpenMP: ON -- TEST: ON -- --Unit Test: OFF -- Quantization: OFF -- ModelCheck: OFF -- DEBUG: OFF -- PROFILE: OFF -- BENCHMARK: OFF -- BENCHMARK Layer: OFF -- Model Converter: OFF -- ONNX2TNN Converter: OFF -- TNN2MEM: OFF -- BENCHMARK Test Lib: OFF -- Dynamic Range Quantization: OFF -- Found PythonInterp: /usr/bin/python3 (found version "3.9.6") Generate OpenCL Source done !!!
-- Build TNN OpenCL -- Looking for C++ include unistd.h -- Looking for C++ include unistd.h - found -- Looking for C++ include stdint.h -- Looking for C++ include stdint.h - found -- Looking for C++ include inttypes.h -- Looking for C++ include inttypes.h - found -- Looking for C++ include sys/types.h -- Looking for C++ include sys/types.h - found -- Looking for C++ include sys/stat.h -- Looking for C++ include sys/stat.h - found -- Looking for C++ include fnmatch.h -- Looking for C++ include fnmatch.h - found -- Looking for C++ include stddef.h -- Looking for C++ include stddef.h - found -- Check size of uint32_t -- Check size of uint32_t - done -- Looking for strtoll -- Looking for strtoll - found -- Configuring done -- Generating done -- Build files have been written to: /Users/joseph/Projects/Mobile/TNN/scripts/build32 [ 0%] ... [ 100%] **** step 3: start build rpn arm64 **** remove build64 arm64-v8a -- android-14 is unsupported. Using minimum supported version 16. -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: /Users/joseph/Downloads/android-ndk-r21b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang /Users/joseph/Projects/Mobile/TNN /Users/joseph/Projects/Mobile/TNN -- Found OpenMP_C: -fopenmp=libomp (found version "3.1") -- Found OpenMP_CXX: -fopenmp=libomp (found version "3.1") -- Found OpenMP: TRUE (found version "3.1")
-- >>>>>>>>>>>>> -- TNN BUILD INFO: -- System: Android -- Processor: aarch64 -- Cpu: ON -- X86: OFF -- Arm: ON -- Arm82: ON -- Metal: OFF -- OpenCL: ON -- CUDA: OFF -- DSP: OFF -- Atlas: OFF -- TensorRT: OFF -- AppleNPU: OFF -- HuaweiNPU: OFF -- RKNPU: OFF -- Jetson Nano: OFF -- OpenVINO: OFF -- OpenMP: ON -- TEST: ON -- --Unit Test: OFF -- Quantization: OFF -- ModelCheck: OFF -- DEBUG: OFF -- PROFILE: OFF -- BENCHMARK: OFF -- BENCHMARK Layer: OFF -- Model Converter: OFF -- ONNX2TNN Converter: OFF -- TNN2MEM: OFF -- BENCHMARK Test Lib: OFF -- Dynamic Range Quantization: OFF -- Found PythonInterp: /usr/bin/python3 (found version "3.9.6") Generate OpenCL Source done !!!
-- Build TNN OpenCL -- Looking for C++ include unistd.h -- Looking for C++ include unistd.h - found -- Looking for C++ include stdint.h -- Looking for C++ include stdint.h - found -- Looking for C++ include inttypes.h -- Looking for C++ include inttypes.h - found -- Looking for C++ include sys/types.h -- Looking for C++ include sys/types.h - found -- Looking for C++ include sys/stat.h -- Looking for C++ include sys/stat.h - found -- Looking for C++ include fnmatch.h -- Looking for C++ include fnmatch.h - found -- Looking for C++ include stddef.h -- Looking for C++ include stddef.h - found -- Check size of uint32_t -- Check size of uint32_t - done -- Looking for strtoll -- Looking for strtoll - found -- Configuring done -- Generating done -- Build files have been written to: /Users/joseph/Projects/Mobile/TNN/scripts/build64 [ 0%] ... [100%] Built target TNNTest
**** step 4: add version attr **** **** step 4: copy to release **** build done!
7. 截图(Screenshots)