Dear SNPE developers,
I have encountered a problem when trying the example for UDL in SNPE runtime.
switching to the folder: ~/Downloads/snpe-1.8.0/examples/NativeCpp/UdlExample and executing:
$ make -f Makefile.x86_64-linux-clang
The output log is shown below:
-----------------------------------------------------------------------
mkdir -p obj/local/x86_64-linux-clang
g++ -c -std=c++11 -fPIC -march=x86-64 -I /home/yanbo/Downloads/snpe-1.8.0/include -I /home/yanbo/Downloads/snpe-1.8.0/include/zdl jni/udlMyCustomScaleLayer.cpp -o obj/local/x86_64-linux-clang/udlMyCustomScaleLayer.o
g++ -c -std=c++11 -fPIC -march=x86-64 -I /home/yanbo/Downloads/snpe-1.8.0/include -I /home/yanbo/Downloads/snpe-1.8.0/include/zdl jni/main.cpp -o obj/local/x86_64-linux-clang/main.o
In file included from jni/main.cpp:64:0:
/home/yanbo/Downloads/snpe-1.8.0/include/zdl/DlSystem/DlError.hpp:168:1: warning: type attributes ignored after type is already defined [-Wattributes]
};
^
g++ -L /home/yanbo/Downloads/snpe-1.8.0/lib/x86_64-linux-clang obj/local/x86_64-linux-clang/udlMyCustomScaleLayer.o obj/local/x86_64-linux-clang/main.o -lSNPE -o obj/local/x86_64-linux-clang/snpe-net-run-udl
obj/local/x86_64-linux-clang/main.o: In function `main':
main.cpp:(.text+0x5d0): undefined reference to `zdl::DlContainer::IDlContainer::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main.cpp:(.text+0x9eb): undefined reference to `zdl::DlSystem::Version_t::toString[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
Makefile.x86_64-linux-clang:41: recipe for target 'obj/local/x86_64-linux-clang/snpe-net-run-udl' failed
make: *** [obj/local/x86_64-linux-clang/snpe-net-run-udl] Error 1
----------------------------------------------------------------------
By the way, I have no problem in converting my mnist caffemodel (containing MyCustomScale layer) into dlc file, by calling snpe-to-caffe-dlc-udl.
Would you please help resolve this issue for SNPE runtime?
Best regards,
By switching to gcc4.9, the problem was sloved. I think it would be useful to make a note in the tutorial by explicitly pointing out the exact gcc version used for complilation.
Best regards,
I also met these error. My gcc version is 5.4.0.
I changed the original code
container = zdl::DlContainer::IDlContainer::open(ContainerPath) to container = zdl::DlContainer::IDlContainer::open(zdl::DlSystem::String(ContainerPath.c_str()))
and chang original code std::cout << "SNPE v" << zdl::SNPE::SNPEFactory::getLibraryVersion().toString() << "\n"; to std::cout << "SNPE v" << zdl::SNPE::SNPEFactory::getLibraryVersion().asString() << "\n";
These changes work for me. You can have a try^_^
PS: Suggest use clang++ instead of g++ to compile these code.