xiangweizeng / darknet2ncnn

Darknet2ncnn converts the darknet model to the ncnn model
Do What The F*ck You Want To Public License
158 stars 56 forks source link

make error #1

Closed shartoo closed 5 years ago

shartoo commented 5 years ago

ncnn make error when execute make -j8

In file included from /home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_arm.cpp:27:0:
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h: In function ‘void ncnn::convdw3x3s2_int8_neon(const ncnn::Mat&, ncnn::Mat&, const ncnn::Mat&, const ncnn::Option&)’:
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:679:9: error: ‘int8x8_t’ was not declared in this scope
         int8x8_t _k0 = vdup_n_s8(kernel[0]);
         ^~~~~~~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:680:18: error: expected ‘;’ before ‘_k1’
         int8x8_t _k1 = vdup_n_s8(kernel[1]);
                  ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:681:18: error: expected ‘;’ before ‘_k2’
         int8x8_t _k2 = vdup_n_s8(kernel[2]);
                  ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:682:18: error: expected ‘;’ before ‘_k3’
         int8x8_t _k3 = vdup_n_s8(kernel[3]);
                  ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:683:18: error: expected ‘;’ before ‘_k4’
         int8x8_t _k4 = vdup_n_s8(kernel[4]);
                  ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:684:18: error: expected ‘;’ before ‘_k5’
         int8x8_t _k5 = vdup_n_s8(kernel[5]);
                  ^~~
...
                           ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:753:27: error: ‘_k5’ was not declared in this scope
                       "w"(_k5),             // %15
                           ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:754:27: error: ‘_k6’ was not declared in this scope
                       "w"(_k6),             // %16
                           ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:755:27: error: ‘_k7’ was not declared in this scope
                       "w"(_k7),             // %17
                           ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:756:27: error: ‘_k8’ was not declared in this scope
                       "w"(_k8)              // %18
                           ^~~
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:653:9: warning: unused variable ‘h’ [-Wunused-variable]
     int h = bottom_blob.h;
         ^
/home/pi/workspace/darknet2ncnn/ncnn/src/layer/arm/convolutiondepthwise_3x3_int8.h:654:9: warning: unused variable ‘inch’ [-Wunused-variable]
     int inch = bottom_blob.c;
         ^~~~
src/CMakeFiles/ncnn.dir/build.make:1574: recipe for target 'src/CMakeFiles/ncnn.dir/layer/arm/convolutiondepthwise_arm.cpp.o' failed
make[2]: *** [src/CMakeFiles/ncnn.dir/layer/arm/convolutiondepthwise_arm.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/ncnn.dir/all' failed
make[1]: *** [src/CMakeFiles/ncnn.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
xiangweizeng commented 5 years ago

Please modify ncnn/CMakeLists.txt 53 line, PI3 -> 1, continue to compile after reconfiguration, like that: 52 53 if(1) 54 add_definitions(-march=native) 55 add_definitions(-mfpu=neon) 56 add_definitions(-mfloat-abi=hard) 57 add_definitions(-DARM_NEON) 58 add_definitions(-DANDROID__) 59 endif()

shartoo commented 5 years ago

Thank you ,it works, but another error was throw when execute make in directory ./darknet2ncnn

pi@raspberrypi:~/workspace/darknet2ncnn $ make -j8
make: Nothing to be done for 'all'.

And another make command make cifar fails too.

pi@raspberrypi:~/workspace/darknet2ncnn $ make cifar
./darknet2ncnn data/cifar.cfg  data/cifar.backup example/zoo/cifar.param  example/zoo/cifar.bin 
./darknet2ncnn: error while loading shared libraries: libdarknet.so: cannot open shared object file: No such file or directory
Makefile:66: recipe for target 'cifar' failed
make: *** [cifar] Error 127
xiangweizeng commented 5 years ago

You can remove darknet/libdarknet.so and the link will use darknet/libdarknet.a,

rm darknet/libdarknet.so
make clean
make cifar
shartoo commented 5 years ago

Thank you ,it works now.