nnstreamer / nntrainer

NNtrainer is Software Framework for Training Neural Network Models on Devices.
Apache License 2.0
134 stars 71 forks source link

Issue in running the resnet18 example. #2600

Closed udit01 closed 1 month ago

udit01 commented 1 month ago

I am using -C option instead of -c in the example guide: https://github.com/nnstreamer/nntrainer/tree/main/Applications/Resnet (Because I think it is a typo, already filed a PR regarding that). While build, it shows, that nnstreamer-test-devel dependency is not found. Although, I have installed that and nntrainer dependency both from the PPA. I am using ubuntu 22 , Some package dependency errors in libiniparser and opencv as well. Could you please recommend how to run the example? Thank you. Output on running the test.

(base) udit@anon:~/viproj/nntrainer$ meson --reconfigure builddir/ -Denable-test=true -Denable-long-test=true 
The Meson build system
Version: 0.61.2
Source dir: /home/udit/viproj/nntrainer
Build dir: /home/udit/viproj/nntrainer/builddir
Build type: native build
Project name: nntrainer
Project version: 0.5.0
C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-2ubuntu1~18.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
C++ compiler for the host machine: c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-2ubuntu1~18.04) 11.4.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: OpenCL kernel path set to: nntrainer_opencl_kernels
Compiler for C supports arguments -Wredundant-decls: YES (cached)
Compiler for C++ supports arguments -Wredundant-decls: YES (cached)
Compiler for C supports arguments -Wwrite-strings: YES (cached)
Compiler for C++ supports arguments -Wwrite-strings: YES (cached)
Compiler for C supports arguments -Wformat: YES (cached)
Compiler for C++ supports arguments -Wformat: YES (cached)
Compiler for C supports arguments -Wformat-nonliteral: YES (cached)
Compiler for C++ supports arguments -Wformat-nonliteral: YES (cached)
Compiler for C supports arguments -Wformat-security: YES (cached)
Compiler for C++ supports arguments -Wformat-security: YES (cached)
Compiler for C supports arguments -Winit-self: YES (cached)
Compiler for C++ supports arguments -Winit-self: YES (cached)
Compiler for C supports arguments -Waddress: YES (cached)
Compiler for C++ supports arguments -Waddress: YES (cached)
Compiler for C supports arguments -Wvla: YES (cached)
Compiler for C++ supports arguments -Wvla: YES (cached)
Compiler for C supports arguments -Wpointer-arith: YES (cached)
Compiler for C++ supports arguments -Wpointer-arith: YES (cached)
Compiler for C supports arguments -Wno-error=varargs: YES (cached)
Compiler for C++ supports arguments -Wno-error=varargs: YES (cached)
Compiler for C supports arguments -Wdefaulted-function-deleted: NO (cached)
Compiler for C++ supports arguments -Wdefaulted-function-deleted: NO (cached)
Compiler for C supports arguments -ftree-vectorize: YES (cached)
Compiler for C++ supports arguments -ftree-vectorize: YES (cached)
Compiler for C supports arguments -Wno-maybe-uninitialized: YES (cached)
Compiler for C++ supports arguments -Wno-maybe-uninitialized: YES (cached)
Compiler for C supports arguments -Wno-unused-variable: YES (cached)
Compiler for C++ supports arguments -Wno-unused-variable: YES (cached)
Compiler for C supports arguments -Wmissing-declarations: YES (cached)
Compiler for C supports arguments -Wmissing-include-dirs: YES (cached)
Compiler for C supports arguments -Wmissing-prototypes: YES (cached)
Compiler for C supports arguments -Wnested-externs: YES (cached)
Compiler for C supports arguments -Waggregate-return: YES (cached)
Compiler for C supports arguments -Wold-style-definition: YES (cached)
Compiler for C supports arguments -Wdeclaration-after-statement: YES (cached)
Compiler for C supports arguments -Wno-error=varargs: YES (cached)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
Dependency capi-ml-common found: YES 1.8.5 (cached)
Dependency capi-ml-inference found: YES 1.8.5 (cached)
Dependency openblas found: YES 0.3.20 (cached)
Message: set nntrainer num threads=1
Dependency openmp found: YES 4.5 (cached)
Message: set nntrainer omp threads=1
Dependency gmock found: YES unknown (cached)
Dependency gtest found: YES 1.11.0 (cached)
Dependency gtest found: YES 1.11.0 (cached)
Library m found: YES
Library dl found: YES
Dependency threads found: YES unknown (cached)
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Dependency iniparser found: NO found 3.2 but need: '>=4.1'
Found CMake: /home/udit/.local/bin/cmake (3.27.5)
Run-time dependency iniparser found: NO (tried pkgconfig and cmake)
Message: falling back to find libiniparser library and header files
Library iniparser found: YES
Has header "iniparser.h" : YES (cached)
Dependency tensorflow2-lite found: YES 2.15.0 (cached)
Run-time dependency opencv found: NO (tried pkgconfig and cmake)
Run-time dependency opencv4 found: NO (tried pkgconfig and cmake)
Run-time dependency opencv3 found: NO (tried pkgconfig and cmake)
Program flatc found: YES (/usr/bin/flatc)
Configuring nntrainer.pc using configuration
Configuring nntrainer.ini using configuration
meson.build:404: WARNING: The variable(s) 'MEMORY_SWAP_LOOKAHEAD' in the input file 'nntrainer.ini.in' are not present in the given configuration data.
Message: NNTRAINER_CONF_PATH=/usr/local/etc/nntrainer.ini
Message: extra defines are:-DMIN_CPP_VERSION=201703L -DOPENCL_KERNEL_PATH=nntrainer_opencl_kernels -DML_API_COMMON=1 -DNNSTREAMER_AVAILABLE=1 -DUSE_BLAS=1 -DNNTR_NUM_THREADS=1 -DOMP_NUM_THREADS=1 -D__LOGGING__=1 -DENABLE_TEST=1 -DREDUCE_TOLERANCE=1 -DENABLE_TFLITE_BACKBONE=1 -DENABLE_TFLITE_INTERPRETER=1 -DNNTRAINER_CONF_PATH="/usr/local/etc/nntrainer.ini"
Configuring ccapi-ml-training.pc using configuration
Configuring capi-ml-training.pc using configuration
Run-time dependency nnstreamer-test-devel found: NO (tried pkgconfig and cmake)
Dependency jsoncpp found: YES 1.9.5 (cached)
Dependency libcurl found: YES 7.81.0 (cached)
Dependency nnstreamer found: YES 2.4.1 (cached)
Message: building nnstreamer
Build targets in project: 74
NOTICE: Future-deprecated features used:
 * 0.56.0: {'meson.source_root', 'meson.build_root'}

nntrainer 0.5.0

  User defined options
    enable-long-test: true
    enable-test     : true

Found ninja-1.10.1 at /usr/bin/ninja
Generating targets:   0%|                                                    | 0Generating targets:   4%|█▊                                          | 3/74 [00:Generating targets:  41%|█████████████████                         | 30/74 [00:0                                                                                Writing build.ninja:   0%|                                                  | 0/                                                                                (base) udit@anon:~/viproj/nntrainer$ meson test app_resnet18 -v -C builddir
ninja: Entering directory `/home/udit/viproj/nntrainer/builddir'
ninja: no work to do.
1/1 app_resnet18        RUNNING       
>>> OPENBLAS_NUM_THREADS=4 MALLOC_PERTURB_=206 /home/udit/viproj/nntrainer/builddir/Applications/Resnet/jni/nntrainer_resnet18 fake 1 128 1

1/1 app_resnet18        FAIL             0.03s   exit status 127
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stderr:
/home/udit/viproj/nntrainer/builddir/Applications/Resnet/jni/nntrainer_resnet18: symbol lookup error: /home/udit/viproj/nntrainer/builddir/Applications/Resnet/jni/nntrainer_resnet18: undefined symbol: _ZN9nntrainer15createLayerNodeERKN2ml5train9LayerTypeERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EERKNS1_18LayerComputeEngineE
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Summary of Failures:

1/1 app_resnet18 FAIL             0.03s   exit status 127

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/udit/viproj/nntrainer/builddir/meson-logs/testlog.txt

Attached the full log file mentioned above /home/udit/viproj/nntrainer/builddir/meson-logs/testlog.txt :

taos-ci commented 1 month ago

:octocat: cibot: Thank you for posting issue #2600. The person in charge will reply soon.

udit01 commented 1 month ago

Attached the full log file mentioned above /home/udit/viproj/nntrainer/builddir/meson-logs/testlog.txt : testlog.txt

myungjoo commented 1 month ago

Are you really running it on Ubuntu 22.04? Your log says:

C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-2ubuntu1~18.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
C++ compiler for the host machine: c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-2ubuntu1~18.04) 11.4.0")

If you are really running it on Ubuntu 22.04, you may need to clean up build tools, first. This also may imply that your apt source configuration is broken; you are installing packages from 22.04 and 18.04 mixed up, which may also imply that the PPA installation is mixed up (getting nnstreamer/nntrainer packages from 18.04 and 22.04). This will break inter-package dependencies, too.

As you can see in any successful PR's github-action log, it's being successfully built and tested in Ubuntu 22.04 and 20.04.

The error message can also be related to toolchain issues: the linux loader cannot find the symbol marked by toolchain.

myungjoo commented 1 month ago

Without further follow-up questions, I assume that this is resolved.