Closed bestpower closed 3 years ago
同样的问题,没有输出
@bestpower hotfix_issue_1109分支修复了附件中的模型运行失败的问题,请切换至该分支测试。
@Wanger-SJTU hotfix_issue_1109增加了android命令行log输出
@bestpower hotfix_issue_1109分支修复了附件中的模型运行失败的问题,请切换至该分支测试。
我这边重新切了分支编译测试,之前的问题模型可以输出测试结果了,但我把之前能跑通的模型也同时做了测试,发现每个模型的平均耗时都比我之前测试的多了1/3左右, 测试参数配置和测试设备环境都和原来的一样,不知道是什么原因。
@bestpower 修复的问题只针对softmax层axis参数为负数的情况,对其他层不会有影响。如果测试发现有稳定的性能差异,麻烦提供对应的tnn版本号,编译选项,运行环境以及模型,以便我们复现。
@bestpower 修复的问题只针对softmax层axis参数为负数的情况,对其他层不会有影响。如果测试发现有稳定的性能差异,麻烦提供对应的tnn版本号,编译选项,运行环境以及模型,以便我们复现。
我这边一直没有复现出来性能差异问题,原来的环境找不回来了,先暂时不管了,不过我这边用你说的这个分支上编译出来的库和转换的模型放到安卓端应用里推理得不到正确结果,我这个模型是做人脸检测的,节点输出的Dim都对,但是generate后没有任何人脸信息的输出,应该是模型转换还是有问题。
@bestpower 修复的问题只针对softmax层axis参数为负数的情况,对其他层不会有影响。如果测试发现有稳定的性能差异,麻烦提供对应的tnn版本号,编译选项,运行环境以及模型,以便我们复现。
我这边一直没有复现出来性能差异问题,原来的环境找不回来了,先暂时不管了,不过我这边用你说的这个分支上编译出来的库和转换的模型放到安卓端应用里推理得不到正确结果,我这个模型是做人脸检测的,节点输出的Dim都对,但是generate后没有任何人脸信息的输出,应该是模型转换还是有问题。
补充:经验证原始onnx模型没有问题,同样的原始onnx模型,在通过mnn框架的转换与部署可以得到正确的结果,而在tnn上就不行,而generate代码用的是同一套。
@bestpower 转模型或者模型对齐问题,麻烦新开一个issue详细说明,我们会继续跟进。
1. 环境(environment)
RunTime DEVICE: ARM
2. Github版本
commit(optional):79e3a748bc4811c8e276a457a60047fd03d173ea
3. 编译方式(compile method) 模型转换命令:python3 converter.py onnx2tnn $ONNX_MODEL_DIR/${onnx_model} -optimize -v v3.0.0 -o $OUTPUT_TNN_MODEL_DIR/ 运行源码自带benchmark编译混合脚本:TNN/benchmark/benchmark_android/benchmark_models.sh 脚本关键配置: ABI="armeabi-v7a with NEON" STL="c++_static" PROFILING="OFF" CLEAN="-c" DEVICE_TYPE="CPU" MODEL_TYPE=TNN USE_NCNN_MODEL=0 KERNEL_TUNE="-et" THREAD_NUM=4 ADB=adb BENCHMARK_TYPE="SHELL" BENCHMARK_APP_DIR=benchmark_app/benchmark/
WORK_DIR=
pwd
BENCHMARK_MODEL_DIR=$WORK_DIR/../benchmark-model BUILD_DIR=build BUILD_APP_DIR=build_app ANDROID_DIR=/data/local/tmp/tnn-benchmark ANDROID_DATA_DIR=$ANDROID_DIR/benchmark-model OUTPUT_LOG_FILE=benchmark_models_result.txt LOOP_COUNT=100 WARM_UP_COUNT=10 INTERVAL=54. 编译日志(build log) 模型转换日志: ---------- convert model, please wait a moment ----------
Converter ONNX to TNN Model...
Converter ONNX to TNN check_onnx_dim...
Converter ONNX to TNN check_onnx_dim...
Converter ONNX to TNN model succeed!
benchmark混合脚本编译日志: -- android-14 is unsupported. Using minimum supported version 16. -- Check for working C compiler: /home/wyu/SDK/NDK/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- Check for working C compiler: /home/wyu/SDK/NDK/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /home/wyu/SDK/NDK/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- Check for working CXX compiler: /home/wyu/SDK/NDK/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is Clang -- Found assembler: /home/wyu/SDK/NDK/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang /home/wyu/github_projects/TNN /home/wyu/github_projects/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") >::size_type' (aka 'unsigned int') [-Wformat]
LOGE("Error: Arm layer acc don't support GridSample input size(%lu) or param:(%d, %d, %d)\n", input_dims.size(),
-- >>>>>>>>>>>>> -- TNN BUILD INFO: -- System: Android -- Processor: armv7-a -- Cpu: ON -- X86: OFF -- Arm: ON -- Arm82: OFF -- Metal: OFF -- OpenCL: OFF -- CUDA: OFF -- DSP: OFF -- Atlas: OFF -- TensorRT: OFF -- HuaweiNPU:
-- RKNPU: OFF -- OpenVINO: OFF -- OpenMP: ON -- TEST: ON -- --Unit Test: OFF -- Quantization: OFF -- ModelCheck: OFF -- DEBUG:
-- PROFILE: OFF -- BENCHMARK: ON -- BENCHMARK Layer: OFF -- Model Converter: OFF -- ONNX2TNN Converter: OFF -- TNN2MEM: OFF -- BENCHMARK Test Lib: ON -- 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: /home/wyu/github_projects/TNN/benchmark/benchmark_android/build Scanning dependencies of target gflags_nothreads_static Scanning dependencies of target TNNArm Scanning dependencies of target TNNCpu [ 0%] Building CXX object third_party/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags.cc.o [ 0%] Building CXX object third_party/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_reporting.cc.o [ 0%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/compute/compute_elewise.cc.o [ 1%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_abs_layer_acc.cc.o [ 1%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/compute/compute_int8.cc.o [ 1%] Building CXX object third_party/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_completions.cc.o [ 1%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpuhistogram_layer_acc.cc.o [ 1%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_add_layer_acc.cc.o [ 1%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_arg_max_or_min_layer_acc.cc.o [ 2%] Linking CXX static library libgflags_nothreads.a [ 2%] Built target gflags_nothreads_static [ 2%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_batch_norm_layer_acc.cc.o [ 2%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_abs_layer_acc.cc.o [ 2%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_binary_layer_acc.cc.o [ 2%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_cast_layer_acc.cc.o [ 3%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_acos_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_clip_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_concat_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_add_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_detection_output_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_div_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_elu_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_arg_max_or_min_layer_acc.cc.o [ 4%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_exp_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_expand_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_asin_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_floor_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_gather_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_grid_sample_layer_acc.cc.o [ 5%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_atan_layer_acc.cc.o /home/wyu/github_projects/TNN/source/tnn/device/arm/acc/arm_grid_sample_layer_acc.cc:196:103: warning: format specifies type 'unsigned long' but the argument has type 'std::ndk1::vector<int, std::__ndk1::allocator