hustvl / TopFormer

TopFormer: Token Pyramid Transformer for Mobile Semantic Segmentation, CVPR2022
Other
385 stars 42 forks source link

TNN推理无法进行 #24

Closed vozhuo closed 2 years ago

vozhuo commented 2 years ago

TNN推理没有办法进行,我用的README里面提供的TopFormer-T_512x512_2x8_160k-33.6.pth,按照tnn_runtime里的流程转换。

首先我写了一个onnx.sh,用于转换ONNX

CONFIG=$1
CHECK=$2

PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \
python $(dirname "$0")/convert2onnx.py $CONFIG --shape 512 512 --checkpoint $CHECK

convert2onnx.py文件里面我只在torch.onnx.export里面添加了一个opset_version=11,其他未改。

之后执行命令:bash tools/onnx.sh local_configs/topformer/topformer_tiny_512x512_160k_2x8_ade20k.py <path>/TopFormer-T_512x512_2x8_160k-33.6.pth

输出以下结果: image

按照TNN的convert.md自行编译convert2tnn,之后执行命令:python3 converter.py onnx2tnn <path>/topformer_t.onnx -optimize -v=v3.0

再按照TNN的profiling.md进行Android平台耗时测试。执行的代码是./benchmark_models.sh -c。我用TNN代码库提供一个样例squeezenet_v1.1.tnnproto试了一下是可以正常在我的手机上测试的,但是我转的tnnproto就不能运行,会一直卡住,见下图: image

如果我把TNN转换时的-optimize参数去掉,就不会卡住,但是会报错: image

相关工具的版本:

ndk:android-ndk-r23c
Cmake:3.21.7
TNN用的最新版代码库:[20b2b7a](https://github.com/Tencent/TNN/commit/20b2b7a068c1bb6f1efb701009bece82e7a80bb4)

Python环境:

_libgcc_mutex             0.1                        main    defaults
_openmp_mutex             5.1                       1_gnu    defaults
addict                    2.4.0                    pypi_0    pypi
anyio                     3.6.1            py38h578d9bd_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0           py38h0a891b7_2    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
babel                     2.10.3             pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
blas                      1.0                         mkl    defaults
bleach                    5.0.1              pyhd8ed1ab_0    conda-forge
bottleneck                1.3.5            py38h7deecbd_0    defaults
brotli                    1.0.9                he6710b0_2    defaults
brotlipy                  0.7.0           py38h0a891b7_1004    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2022.07.19           h06a4308_0    defaults
certifi                   2022.6.15        py38h06a4308_0    defaults
cffi                      1.15.0           py38hd667e15_1    defaults
charset-normalizer        2.1.0              pyhd8ed1ab_0    conda-forge
click                     8.1.3                    pypi_0    pypi
codecov                   2.1.12                   pypi_0    pypi
colorama                  0.4.5                    pypi_0    pypi
coloredlogs               15.0.1                   pypi_0    pypi
commonmark                0.9.1                    pypi_0    pypi
coverage                  6.4.2                    pypi_0    pypi
cryptography              35.0.0           py38h3e25421_2    conda-forge
cudatoolkit               11.1.1              ha002fc5_10    conda-forge
cycler                    0.11.0             pyhd3eb1b0_0    defaults
dbus                      1.13.18              hb2f20db_0    defaults
debugpy                   1.6.0            py38hfa26641_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
executing                 0.9.1              pyhd8ed1ab_0    conda-forge
expat                     2.4.4                h295c915_0    defaults
ffmpeg                    4.3                  hf484d3e_0    pytorch
flake8                    4.0.1                    pypi_0    pypi
flatbuffers               2.0                      pypi_0    pypi
flit-core                 3.7.1              pyhd8ed1ab_0    conda-forge
fontconfig                2.13.1               h6c09931_0    defaults
fonttools                 4.25.0             pyhd3eb1b0_0    defaults
freetype                  2.11.0               h70c0345_0    defaults
glib                      2.69.1               h4ff587b_1    defaults
gmp                       6.2.1                h58526e2_0    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
gst-plugins-base          1.14.0               h8213a91_2    defaults
gstreamer                 1.14.0               h28cd5cc_2    defaults
humanfriendly             10.0                     pypi_0    pypi
icu                       58.2                 he6710b0_3    defaults
idna                      3.3                pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.4           py38h578d9bd_0    conda-forge
importlib_metadata        4.11.4               hd8ed1ab_0    conda-forge
importlib_resources       5.9.0              pyhd8ed1ab_0    conda-forge
iniconfig                 1.1.1                    pypi_0    pypi
intel-openmp              2021.4.0          h06a4308_3561    defaults
interrogate               1.5.0                    pypi_0    pypi
ipykernel                 6.15.1             pyh210e3f2_0    conda-forge
ipython                   8.4.0            py38h578d9bd_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     4.3.21                   pypi_0    pypi
jedi                      0.18.1           py38h578d9bd_1    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jpeg                      9b                   h024ee3a_2    defaults
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonschema                4.7.2              pyhd8ed1ab_0    conda-forge
jupyter_client            7.0.6              pyhd8ed1ab_0    conda-forge
jupyter_core              4.11.1           py38h578d9bd_0    conda-forge
jupyter_server            1.18.1             pyhd8ed1ab_0    conda-forge
jupyterlab                3.4.4              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.15.0             pyhd8ed1ab_0    conda-forge
kiwisolver                1.4.2            py38h295c915_0    defaults
lame                      3.100             h7f98852_1001    conda-forge
ld_impl_linux-64          2.38                 h1181459_1    defaults
libffi                    3.3                  he6710b0_2    defaults
libgcc-ng                 11.2.0               h1234567_1    defaults
libgfortran-ng            7.5.0               ha8ba4b0_17    defaults
libgfortran4              7.5.0               ha8ba4b0_17    defaults
libgomp                   11.2.0               h1234567_1    defaults
libiconv                  1.17                 h166bdaf_0    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libstdcxx-ng              11.2.0               h1234567_1    defaults
libtiff                   4.1.0                h2733197_1    defaults
libuuid                   1.0.3                h7f8727e_2    defaults
libuv                     1.43.0               h7f98852_0    conda-forge
libxcb                    1.15                 h7f8727e_0    defaults
libxml2                   2.9.14               h74e7548_0    defaults
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
markupsafe                2.1.1            py38h0a891b7_1    conda-forge
matplotlib                3.5.1            py38h06a4308_1    defaults
matplotlib-base           3.5.1            py38ha18d171_1    defaults
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mccabe                    0.6.1                    pypi_0    pypi
mistune                   0.8.4           py38h497a2fe_1005    conda-forge
mkl                       2021.4.0           h06a4308_640    defaults
mkl-service               2.4.0            py38h95df7f1_0    conda-forge
mkl_fft                   1.3.1            py38h8666266_1    conda-forge
mkl_random                1.2.2            py38h1abd341_0    conda-forge
mmcv-full                 1.3.14                   pypi_0    pypi
mpmath                    1.2.1                    pypi_0    pypi
munkres                   1.1.4                      py_0    defaults
nbclassic                 0.4.3              pyhd8ed1ab_0    conda-forge
nbclient                  0.6.6              pyhd8ed1ab_0    conda-forge
nbconvert                 6.5.0              pyhd8ed1ab_0    conda-forge
nbconvert-core            6.5.0              pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          6.5.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.4.0              pyhd8ed1ab_0    conda-forge
ncurses                   6.3                  h5eee18b_3    defaults
nest-asyncio              1.5.5              pyhd8ed1ab_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
ninja                     1.11.0               h924138e_0    conda-forge
notebook                  6.4.12             pyha770c72_0    conda-forge
notebook-shim             0.1.0              pyhd8ed1ab_0    conda-forge
numexpr                   2.8.3            py38h807cd23_0    defaults
numpy                     1.22.3           py38he7a7128_0    defaults
numpy-base                1.22.3           py38hf524024_0    defaults
olefile                   0.46               pyh9f0ad1d_1    conda-forge
onnx                      1.12.0                   pypi_0    pypi
onnx-simplifier           0.4.1                    pypi_0    pypi
onnxruntime               1.12.0                   pypi_0    pypi
opencv-python             4.6.0.66                 pypi_0    pypi
openh264                  2.1.1                h780b84a_0    conda-forge
openssl                   1.1.1q               h7f8727e_0    defaults
packaging                 21.3               pyhd3eb1b0_0    defaults
pandas                    1.4.3            py38h6a678d5_0    defaults
pandoc                    2.18                 ha770c72_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h295c915_0    defaults
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    7.1.2            py38hb39fc2d_0    defaults
pip                       22.1.2           py38h06a4308_0    defaults
pluggy                    1.0.0                    pypi_0    pypi
prettytable               3.3.0              pyhd8ed1ab_0    conda-forge
prometheus_client         0.14.1             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.30             pyha770c72_0    conda-forge
protobuf                  3.20.1                   pypi_0    pypi
psutil                    5.9.1            py38h0a891b7_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py                        1.11.0                   pypi_0    pypi
pybind11                  2.10.0                   pypi_0    pypi
pycodestyle               2.8.0                    pypi_0    pypi
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyflakes                  2.4.0                    pypi_0    pypi
pygments                  2.12.0             pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.9                    pypi_0    pypi
pyqt                      5.9.2            py38h05f1152_4    defaults
pyrsistent                0.18.1           py38h0a891b7_1    conda-forge
pysocks                   1.7.1            py38h578d9bd_5    conda-forge
pytest                    7.1.2                    pypi_0    pypi
python                    3.8.13               h12debd9_0    defaults
python-dateutil           2.8.2              pyhd3eb1b0_0    defaults
python-fastjsonschema     2.16.1             pyhd8ed1ab_0    conda-forge
python_abi                3.8                      2_cp38    conda-forge
pytorch                   1.9.0           py3.8_cuda11.1_cudnn8.0.5_0    pytorch
pytz                      2022.1             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0                      pypi_0    pypi
pyzmq                     19.0.2           py38ha71036d_2    conda-forge
qt                        5.9.7                h5867ecd_1    defaults
readline                  8.1.2                h7f8727e_1    defaults
requests                  2.28.1             pyhd8ed1ab_0    conda-forge
rich                      12.5.1                   pypi_0    pypi
scipy                     1.7.3            py38hc147768_0    defaults
seaborn                   0.11.2             pyhd3eb1b0_0    defaults
send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
setuptools                61.2.0           py38h06a4308_0    defaults
sip                       4.19.13          py38h295c915_0    defaults
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.2.0            py38h578d9bd_3    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sqlite                    3.38.5               hc218d9a_0    defaults
stack_data                0.3.0              pyhd8ed1ab_0    conda-forge
sympy                     1.10.1                   pypi_0    pypi
tabulate                  0.8.10                   pypi_0    pypi
terminado                 0.15.0           py38h578d9bd_0    conda-forge
tinycss2                  1.1.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h1ccaba5_0    defaults
toml                      0.10.2                   pypi_0    pypi
tomli                     2.0.1                    pypi_0    pypi
torchaudio                0.9.0                      py38    pytorch
torchvision               0.10.0               py38_cu111    pytorch
tornado                   6.1              py38h27cfd23_0    defaults
traitlets                 5.3.0              pyhd8ed1ab_0    conda-forge
typing_extensions         4.3.0              pyha770c72_0    conda-forge
urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.3.3              pyhd8ed1ab_0    conda-forge
wheel                     0.37.1             pyhd3eb1b0_0    defaults
xdoctest                  1.0.1                    pypi_0    pypi
xz                        5.2.5                h7f8727e_1    defaults
yapf                      0.32.0                   pypi_0    pypi
zeromq                    4.3.4                h9c3ff4c_1    conda-forge
zipp                      3.8.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.12               h7f8727e_2    defaults
zstd                      1.4.9                ha95c52a_0    conda-forge

编译日志,删除了一部分正常的:

-- >>>>>>>>>>>>>
-- 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:
--      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
--      Dynamic Range Quantization:     OFF
-- Found PythonInterp: /home/qyz/miniconda3/envs/p1/bin/python (found version "3.8.13")
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: /mnt/c/Users/ASUS/Desktop/TNN/benchmark/benchmark_android/build
Scanning dependencies of target TNNArm82
Scanning dependencies of target TNNArm

[ 15%] Built target TNNArm82
[ 15%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_log_acc_layer_acc.cc.o
[ 15%] Building CXX object source/tnn/device/opencl/CMakeFiles/TNNOpenCL.dir/acc/opencl_clip_layer_acc.cc.o
[ 15%] Building CXX object source/tnn/device/cpu/CMakeFiles/TNNCpu.dir/acc/cpu_elu_layer_acc.cc.o
[ 16%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_log_sigmoid_layer_acc.cc.o
/mnt/c/Users/ASUS/Desktop/TNN/source/tnn/device/opencl/acc/opencl_clip_layer_acc.cc:42:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
[ 16%] Building CXX object source/tnn/device/arm/CMakeFiles/TNNArm.dir/acc/arm_lstm_layer_acc.cc.o
1 warning generated.

[ 24%] Linking CXX static library libgflags_nothreads.a
[ 24%] Built target gflags_nothreads_static

[ 50%] Built target TNNArm

[ 52%] Built target TNNCpu

[ 53%] Built target TNNOpenCL

[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/blob_dump_utils.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/blob_memory_size_utils.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/blob_transfer_utils.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/cpu_info.cc.o
/mnt/c/Users/ASUS/Desktop/TNN/source/tnn/utils/cpu_info.cc:618:9: warning: array designators are a C99 extension [-Wc99-designator]
        [cpuinfo_android_chipset_property_proc_cpuinfo_hardware] =
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/cpu_utils.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/data_flag_utils.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/data_format_converter.cc.o
[ 95%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/data_type_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/detection_post_process_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/dims_function_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/dims_offset_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/dims_vector_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/exclusive_file.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/half_utils.cc.o
[ 96%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/mat_converter_acc.cc.o
/mnt/c/Users/ASUS/Desktop/TNN/source/tnn/utils/exclusive_file.cc:181:47: warning: 'open' has superfluous mode bits; missing O_CREAT? [-Wuser-defined-warnings]
    int fd = open(fname, O_RDWR | O_EXCL, 0666);
                                              ^
/mnt/c/Users/ASUS/Desktop/Paper/Code/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/bits/fortify/fcntl.h:76:9: note: from 'diagnose_if' attribute on 'open':
        __clang_warning_if(!__open_modes_useful(flags) && modes,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/c/Users/ASUS/Desktop/Paper/Code/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/sys/cdefs.h:139:54: note: expanded from macro '__clang_warning_if'
#define __clang_warning_if(cond, msg) __attribute__((diagnose_if(cond, msg, "warning")))
                                                     ^           ~~~~
1 warning generated.

[ 98%] Linking CXX shared library libTNN.so
[ 98%] Built target TNN
[ 98%] Building CXX object test/CMakeFiles/TNNBenchmarkTest.dir/flags.cc.o
[ 98%] Building CXX object test/CMakeFiles/TNNBenchmarkTest.dir/test.cc.o
[ 99%] Building CXX object test/CMakeFiles/TNNBenchmarkTest.dir/test_utils.cc.o
[ 99%] Building CXX object test/CMakeFiles/TNNTest.dir/flags.cc.o
[100%] Building CXX object test/CMakeFiles/TNNBenchmarkTest.dir/timer.cc.o
[100%] Building CXX object test/CMakeFiles/TNNTest.dir/test.cc.o
[100%] Building CXX object test/CMakeFiles/TNNTest.dir/test_utils.cc.o
[100%] Building CXX object test/CMakeFiles/TNNTest.dir/timer.cc.o
[100%] Linking CXX shared library libTNNBenchmarkTest.so
[100%] Linking CXX executable TNNTest
[100%] Built target TNNBenchmarkTest
[100%] Built target TNNTest
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is Clang 12.0.9
-- The CXX compiler identification is Clang 12.0.9
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /mnt/c/Users/ASUS/Desktop/Paper/Code/android-ndk-r23c/toolchains/llvm/prebuilt/linux-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: /mnt/c/Users/ASUS/Desktop/Paper/Code/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/ASUS/Desktop/TNN/benchmark/benchmark_android/build/build_app
[ 50%] Building CXX object CMakeFiles/tnn_wrapper.dir/src/main/jni/cc/benchmark_model_jni.cc.o
[100%] Linking CXX shared library libtnn_wrapper.so
[100%] Built target tnn_wrapper
Performing Streamed Install
Success
/mnt/c/Users/ASUS/Desktop/TNN/benchmark/benchmark_android/...files pushed, 0 skipped. 1.6 MB/s (525286 bytes in 0.309s)
./build_app/libtnn_wrapper.so: 1 file pushed, 0 skipped. 14.4 MB/s (410776 bytes in 0.027s)
./libTNN.so: 1 file pushed, 0 skipped. 80.9 MB/s (10881800 bytes in 0.128s)
./test/libTNNBenchmarkTest.so: 1 file pushed, 0 skipped. 20.8 MB/s (413080 bytes in 0.019s)

benchmark device: ARM

Stopping: com.tencent.tnn.benchmark
Starting: Intent { cmp=com.tencent.tnn.benchmark/.MainActivity (has extras) }
Status: timeout
LaunchState: UNKNOWN (-1)
Activity: com.tencent.tnn.benchmark/.MainActivity
WaitTime: 10092
Complete
09-01 12:46:42.874 26746 26746 I tnn : void tnn::test::Timer::Print() [File test/timer.cc][Line 60] densenet.tnnproto - ARM TNN Benchmark time cost: min = 525.659 ms | max = 555.620 ms | avg = 531.057 ms
Stopping: com.tencent.tnn.benchmark
Starting: Intent { cmp=com.tencent.tnn.benchmark/.MainActivity (has extras) }
Status: ok
LaunchState: COLD
Activity: com.tencent.tnn.benchmark/.MainActivity
TotalTime: 1373
WaitTime: 1376
Complete
09-01 12:46:50.199 26927 26927 I tnn : void tnn::test::Timer::Print() [File test/timer.cc][Line 60] squeezenet_v1.1.tnnproto - ARM TNN Benchmark time cost: min = 43.554 ms | max = 44.123 ms | avg = 43.744 ms
Stopping: com.tencent.tnn.benchmark
Starting: Intent { cmp=com.tencent.tnn.benchmark/.MainActivity (has extras) }
Status: ok
LaunchState: COLD
Activity: com.tencent.tnn.benchmark/.MainActivity
TotalTime: 357
WaitTime: 360
Complete
09-01 12:46:57.539 27024 27024 I tnn : topformer_t_official2.tnnproto TNN Benchmark time cost failed error code: 4096
Stopping: com.tencent.tnn.benchmark
Starting: Intent { cmp=com.tencent.tnn.benchmark/.MainActivity (has extras) }
Status: ok
LaunchState: UNKNOWN (0)
Activity: com.tencent.tnn.benchmark/.MainActivity
WaitTime: 588
Complete
wmkai commented 2 years ago

执行的代码是./benchmark_models.sh -c。我用TNN代码库提供一个样例squeezenet_v1.1.tnnproto试了一下是可以正常在我的手机上测试的,但是我转的tnnproto就不能运行,会一直卡住,见下图:

Hi,我也碰到了这个问题,请问你解决了吗,方便的话可以加个联系方式交流下

vozhuo commented 2 years ago

Hi,我也碰到了这个问题,请问你解决了吗,方便的话可以加个联系方式交流下

没解决,你可以把联系方式发我邮箱。

vozhuo commented 2 years ago

使用Convert2tnn Docker后问题解决。