Open yukinolove8 opened 2 years ago
看ncnn的github里面的wiki https://github.com/Tencent/ncnn/wiki/how-to-build
dalao我看到注释里写需要使用YOLOV5_CUSTOMLAYER的话需要重新编译 ncnn 或去掉 opencv 照着wiki重新编译了ncnn 得到了build-android-aarch64 build-android-armv7两个文件夹 该怎么使用呢? 另一种去掉opencv的话,我尝试了单纯删除掉\android_YOLOV5_NCNN\app\src\main\cpp\opencv 文件夹,结果会在部署时出现以下问题 Build command failed. Error while executing process E:\Android with arguments {Studio\SDK\cmake\3.10.2.4988404\bin\ninja.exe -C E:\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app.cxx\cmake\debug\arm64-v8a yolov5} ninja: Entering directory `E:\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app.cxx\cmake\debug\arm64-v8a'
ninja: error: 'E:/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/opencv/arm64-v8a/libopencv_java4.so', needed by 'E:/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/build/intermediates/cmake/debug/obj/arm64-v8a/libyolov5.so', missing and no known rule to make it。 请问去掉opencv指的是删除掉那个文件夹吗?
另外从导引的u版yolov5-version5.0 经过ncnn转换得到的模型.param 结构和项目里的 yolov5.param ,yolov5_customlayer.param 两个的结构都不完全相同,请问这是版本的问题还是什么原因呢?
我的模型结构 7767517 176 200 Input images 0 1 images YoloV5Focus focus 1 1 images 167 Convolution Conv_41 1 1 167 168 0=32 1=3 4=1 5=1 6=3456 Swish Mul_43 1 1 168 170 Convolution Conv_44 1 1 170 171 0=64 1=3 3=2 4=1 5=1 6=18432 Swish Mul_46 1 1 171 173 Split splitncnn_0 1 2 173 173_splitncnn_0 173_splitncnn_1 Convolution Conv_47 1 1 173_splitncnn_1 174 0=32 1=1 5=1 6=2048 Swish Mul_49 1 1 174 176 Split splitncnn_1 1 2 176 176_splitncnn_0 176_splitncnn_1 Convolution Conv_50 1 1 176_splitncnn_1 177 0=32 1=1 5=1 6=1024 Swish Mul_52 1 1 177 179 Convolution Conv_53 1 1 179 180 0=32 1=3 4=1 5=1 6=9216 Swish Mul_55 1 1 180 182 BinaryOp Add_56 2 1 176_splitncnn_0 182 183 Convolution Conv_57 1 1 173_splitncnn_0 184 0=32 1=1 5=1 6=2048 Swish Mul_59 1 1 184 186 Concat Concat_60 2 1 183 186 187 Convolution Conv_61 1 1 187 188 0=64 1=1 5=1 6=4096 Swish Mul_63 1 1 188 190 Convolution Conv_64 1 1 190 191 0=128 1=3 3=2 4=1 5=1 6=73728 Swish Mul_66 1 1 191 193 Split splitncnn_2 1 2 193 193_splitncnn_0 193_splitncnn_1 Convolution Conv_67 1 1 193_splitncnn_1 194 0=64 1=1 5=1 6=8192 Swish Mul_69 1 1 194 196 Split splitncnn_3 1 2 196 196_splitncnn_0 196_splitncnn_1 Convolution Conv_70 1 1 196_splitncnn_1 197 0=64 1=1 5=1 6=4096 Swish Mul_72 1 1 197 199 Convolution Conv_73 1 1 199 200 0=64 1=3 4=1 5=1 6=36864 Swish Mul_75 1 1 200 202 BinaryOp Add_76 2 1 196_splitncnn_0 202 203 Split splitncnn_4 1 2 203 203_splitncnn_0 203_splitncnn_1 Convolution Conv_77 1 1 203_splitncnn_1 204 0=64 1=1 5=1 6=4096 Swish Mul_79 1 1 204 206 Convolution Conv_80 1 1 206 207 0=64 1=3 4=1 5=1 6=36864 Swish Mul_82 1 1 207 209 BinaryOp Add_83 2 1 203_splitncnn_0 209 210 Split splitncnn_5 1 2 210 210_splitncnn_0 210_splitncnn_1 Convolution Conv_84 1 1 210_splitncnn_1 211 0=64 1=1 5=1 6=4096 Swish Mul_86 1 1 211 213 Convolution Conv_87 1 1 213 214 0=64 1=3 4=1 5=1 6=36864 Swish Mul_89 1 1 214 216 BinaryOp Add_90 2 1 210_splitncnn_0 216 217 Convolution Conv_91 1 1 193_splitncnn_0 218 0=64 1=1 5=1 6=8192 Swish Mul_93 1 1 218 220 Concat Concat_94 2 1 217 220 221 Convolution Conv_95 1 1 221 222 0=128 1=1 5=1 6=16384 Swish Mul_97 1 1 222 224 Split splitncnn_6 1 2 224 224_splitncnn_0 224_splitncnn_1 Convolution Conv_98 1 1 224_splitncnn_1 225 0=256 1=3 3=2 4=1 5=1 6=294912 Swish Mul_100 1 1 225 227 Split splitncnn_7 1 2 227 227_splitncnn_0 227_splitncnn_1 Convolution Conv_101 1 1 227_splitncnn_1 228 0=128 1=1 5=1 6=32768 Swish Mul_103 1 1 228 230 Split splitncnn_8 1 2 230 230_splitncnn_0 230_splitncnn_1 Convolution Conv_104 1 1 230_splitncnn_1 231 0=128 1=1 5=1 6=16384 Swish Mul_106 1 1 231 233 Convolution Conv_107 1 1 233 234 0=128 1=3 4=1 5=1 6=147456 Swish Mul_109 1 1 234 236 BinaryOp Add_110 2 1 230_splitncnn_0 236 237 Split splitncnn_9 1 2 237 237_splitncnn_0 237_splitncnn_1 Convolution Conv_111 1 1 237_splitncnn_1 238 0=128 1=1 5=1 6=16384 Swish Mul_113 1 1 238 240 Convolution Conv_114 1 1 240 241 0=128 1=3 4=1 5=1 6=147456 Swish Mul_116 1 1 241 243 BinaryOp Add_117 2 1 237_splitncnn_0 243 244 Split splitncnn_10 1 2 244 244_splitncnn_0 244_splitncnn_1 Convolution Conv_118 1 1 244_splitncnn_1 245 0=128 1=1 5=1 6=16384 Swish Mul_120 1 1 245 247 Convolution Conv_121 1 1 247 248 0=128 1=3 4=1 5=1 6=147456 Swish Mul_123 1 1 248 250 BinaryOp Add_124 2 1 244_splitncnn_0 250 251 Convolution Conv_125 1 1 227_splitncnn_0 252 0=128 1=1 5=1 6=32768 Swish Mul_127 1 1 252 254 Concat Concat_128 2 1 251 254 255 Convolution Conv_129 1 1 255 256 0=256 1=1 5=1 6=65536 Swish Mul_131 1 1 256 258 Split splitncnn_11 1 2 258 258_splitncnn_0 258_splitncnn_1 Convolution Conv_132 1 1 258_splitncnn_1 259 0=512 1=3 3=2 4=1 5=1 6=1179648 Swish Mul_134 1 1 259 261 Convolution Conv_135 1 1 261 262 0=256 1=1 5=1 6=131072 Swish Mul_137 1 1 262 264 Split splitncnn_12 1 4 264 264_splitncnn_0 264_splitncnn_1 264_splitncnn_2 264_splitncnn_3 Pooling MaxPool_138 1 1 264_splitncnn_3 265 1=5 3=2 5=1 Pooling MaxPool_139 1 1 264_splitncnn_2 266 1=9 3=4 5=1 Pooling MaxPool_140 1 1 264_splitncnn_1 267 1=13 3=6 5=1 Concat Concat_141 4 1 264_splitncnn_0 265 266 267 268 Convolution Conv_142 1 1 268 269 0=512 1=1 5=1 6=524288 Swish Mul_144 1 1 269 271 Split splitncnn_13 1 2 271 271_splitncnn_0 271_splitncnn_1 Convolution Conv_145 1 1 271_splitncnn_1 272 0=256 1=1 5=1 6=131072 Swish Mul_147 1 1 272 274 Convolution Conv_148 1 1 274 275 0=256 1=1 5=1 6=65536 Swish Mul_150 1 1 275 277 Convolution Conv_151 1 1 277 278 0=256 1=3 4=1 5=1 6=589824 Swish Mul_153 1 1 278 280 Convolution Conv_154 1 1 271_splitncnn_0 281 0=256 1=1 5=1 6=131072 Swish Mul_156 1 1 281 283 Concat Concat_157 2 1 280 283 284 Convolution Conv_158 1 1 284 285 0=512 1=1 5=1 6=262144 Swish Mul_160 1 1 285 287 Convolution Conv_161 1 1 287 288 0=256 1=1 5=1 6=131072 Swish Mul_163 1 1 288 290 Split splitncnn_14 1 2 290 290_splitncnn_0 290_splitncnn_1 Interp Resize_165 1 1 290_splitncnn_1 295 0=1 1=2.000000e+00 2=2.000000e+00 Concat Concat_166 2 1 295 258_splitncnn_0 296 Split splitncnn_15 1 2 296 296_splitncnn_0 296_splitncnn_1 Convolution Conv_167 1 1 296_splitncnn_1 297 0=128 1=1 5=1 6=65536 Swish Mul_169 1 1 297 299 Convolution Conv_170 1 1 299 300 0=128 1=1 5=1 6=16384 Swish Mul_172 1 1 300 302 Convolution Conv_173 1 1 302 303 0=128 1=3 4=1 5=1 6=147456 Swish Mul_175 1 1 303 305 Convolution Conv_176 1 1 296_splitncnn_0 306 0=128 1=1 5=1 6=65536 Swish Mul_178 1 1 306 308 Concat Concat_179 2 1 305 308 309 Convolution Conv_180 1 1 309 310 0=256 1=1 5=1 6=65536 Swish Mul_182 1 1 310 312 Convolution Conv_183 1 1 312 313 0=128 1=1 5=1 6=32768 Swish Mul_185 1 1 313 315 Split splitncnn_16 1 2 315 315_splitncnn_0 315_splitncnn_1 Interp Resize_187 1 1 315_splitncnn_1 320 0=1 1=2.000000e+00 2=2.000000e+00 Concat Concat_188 2 1 320 224_splitncnn_0 321 Split splitncnn_17 1 2 321 321_splitncnn_0 321_splitncnn_1 Convolution Conv_189 1 1 321_splitncnn_1 322 0=64 1=1 5=1 6=16384 Swish Mul_191 1 1 322 324 Convolution Conv_192 1 1 324 325 0=64 1=1 5=1 6=4096 Swish Mul_194 1 1 325 327 Convolution Conv_195 1 1 327 328 0=64 1=3 4=1 5=1 6=36864 Swish Mul_197 1 1 328 330 Convolution Conv_198 1 1 321_splitncnn_0 331 0=64 1=1 5=1 6=16384 Swish Mul_200 1 1 331 333 Concat Concat_201 2 1 330 333 334 Convolution Conv_202 1 1 334 335 0=128 1=1 5=1 6=16384 Swish Mul_204 1 1 335 337 Split splitncnn_18 1 2 337 337_splitncnn_0 337_splitncnn_1 Convolution Conv_205 1 1 337_splitncnn_1 338 0=128 1=3 3=2 4=1 5=1 6=147456 Swish Mul_207 1 1 338 340 Concat Concat_208 2 1 340 315_splitncnn_0 341 Split splitncnn_19 1 2 341 341_splitncnn_0 341_splitncnn_1 Convolution Conv_209 1 1 341_splitncnn_1 342 0=128 1=1 5=1 6=32768 Swish Mul_211 1 1 342 344 Convolution Conv_212 1 1 344 345 0=128 1=1 5=1 6=16384 Swish Mul_214 1 1 345 347 Convolution Conv_215 1 1 347 348 0=128 1=3 4=1 5=1 6=147456 Swish Mul_217 1 1 348 350 Convolution Conv_218 1 1 341_splitncnn_0 351 0=128 1=1 5=1 6=32768 Swish Mul_220 1 1 351 353 Concat Concat_221 2 1 350 353 354 Convolution Conv_222 1 1 354 355 0=256 1=1 5=1 6=65536 Swish Mul_224 1 1 355 357 Split splitncnn_20 1 2 357 357_splitncnn_0 357_splitncnn_1 Convolution Conv_225 1 1 357_splitncnn_1 358 0=256 1=3 3=2 4=1 5=1 6=589824 Swish Mul_227 1 1 358 360 Concat Concat_228 2 1 360 290_splitncnn_0 361 Split splitncnn_21 1 2 361 361_splitncnn_0 361_splitncnn_1 Convolution Conv_229 1 1 361_splitncnn_1 362 0=256 1=1 5=1 6=131072 Swish Mul_231 1 1 362 364 Convolution Conv_232 1 1 364 365 0=256 1=1 5=1 6=65536 Swish Mul_234 1 1 365 367 Convolution Conv_235 1 1 367 368 0=256 1=3 4=1 5=1 6=589824 Swish Mul_237 1 1 368 370 Convolution Conv_238 1 1 361_splitncnn_0 371 0=256 1=1 5=1 6=131072 Swish Mul_240 1 1 371 373 Concat Concat_241 2 1 370 373 374 Convolution Conv_242 1 1 374 375 0=512 1=1 5=1 6=262144 Swish Mul_244 1 1 375 377 Convolution Conv_245 1 1 337_splitncnn_0 378 0=288 1=1 5=1 6=36864 Reshape Reshape_246 1 1 378 390 0=-1 1=96 2=3 Permute Transpose_247 1 1 390 output 0=1 Convolution Conv_248 1 1 357_splitncnn_0 392 0=288 1=1 5=1 6=73728 Reshape Reshape_249 1 1 392 404 0=-1 1=96 2=3 Permute Transpose_250 1 1 404 405 0=1 Convolution Conv_251 1 1 377 406 0=288 1=1 5=1 6=147456 Reshape Reshape_252 1 1 406 418 0=-1 1=96 2=3 Permute Transpose_253 1 1 418 419 0=1
直接删除opencv需要改的比较多。只是想玩下的话可以试试这个,原理类似,也支持Focus自定义层 https://github.com/nihui/ncnn-android-yolox
改下后处理,不需要重新编译,直接下载编译好的ncnn就可以了
是下release,然后替换 android_YOLOV5_NCNN\app\src\main\cpp\ncnn 和ncnnvulkan两个文件夹里面的东西吗?
想玩下的话可以试试这个,按照说明搞一下就可以了 https://github.com/nihui/ncnn-android-yolox
是下release,然后替换 android_YOLOV5_NCNN\app\src\main\cpp\ncnn 和ncnnvulkan两个文件夹里面的东西吗?
这个工程想玩这个YOLOV5_CUSTOMLAYER需要会编译ncnn,会麻烦点,如果完全没基础先搞会ncnn编译吧。工程只要替换ncnnvulkan文件夹的内容就行了,ncnn文件夹是只有cpu版本的。
在linux环境下重新编译了ncnn,替换了ncnnvulkan内的所有内容,还是不能run,还有哪些地方需要修改吗?
错误代码:Build command failed.
Error while executing process E:\Android with arguments {Studio\SDK\cmake\3.10.2.4988404\bin\ninja.exe -C E:\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app.cxx\cmake\debug\arm64-v8a yolov5}
ninja: Entering directory E:\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app\.cxx\cmake\debug\arm64-v8a' [1/1] Linking CXX shared library E:\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app\build\intermediates\cmake\debug\obj\arm64-v8a\libyolov5.so FAILED: E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/build/intermediates/cmake/debug/obj/arm64-v8a/libyolov5.so cmd.exe /C "cd . && "E:\Android Studio\SDK\ndk\21.0.6113669-2\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe" --target=aarch64-none-linux-android24 --gcc-toolchain="E:/Android Studio/SDK/ndk/21.0.6113669-2/toolchains/llvm/prebuilt/windows-x86_64" --sysroot="E:/Android Studio/SDK/ndk/21.0.6113669-2/toolchains/llvm/prebuilt/windows-x86_64/sysroot" -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fopenmp -frtti -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -static-openmp -shared -Wl,-soname,libyolov5.so -o E:\YOLOv5_NCNN-master\YOLOv5_NCNN-master\android_YOLOV5_NCNN\app\build\intermediates\cmake\debug\obj\arm64-v8a\libyolov5.so CMakeFiles/yolov5.dir/DBFace.cpp.o CMakeFiles/yolov5.dir/ENet.cpp.o CMakeFiles/yolov5.dir/FaceLandmark.cpp.o CMakeFiles/yolov5.dir/LightOpenPose.cpp.o CMakeFiles/yolov5.dir/MbnFCN.cpp.o CMakeFiles/yolov5.dir/MobileNetV3Seg.cpp.o CMakeFiles/yolov5.dir/NanoDet.cpp.o CMakeFiles/yolov5.dir/SimplePose.cpp.o CMakeFiles/yolov5.dir/Yolact.cpp.o CMakeFiles/yolov5.dir/YoloV4.cpp.o CMakeFiles/yolov5.dir/YoloV5.cpp.o CMakeFiles/yolov5.dir/YoloV5CustomLayer.cpp.o CMakeFiles/yolov5.dir/jni_interface.cpp.o CMakeFiles/yolov5.dir/ocr/NCNNDBNet.cpp.o CMakeFiles/yolov5.dir/ocr/RRLib.cpp.o CMakeFiles/yolov5.dir/ocr/ZUtil.cpp.o CMakeFiles/yolov5.dir/ocr/clipper.cpp.o CMakeFiles/yolov5.dir/ocr/ocr.cpp.o -llog -lvulkan -landroid -ljnigraphics E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/opencv/arm64-v8a/libopencv_java4.so -llog -lvulkan -landroid -ljnigraphics E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libglslang.a E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libOGLCompiler.a E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libOSDependent.a -latomic -lm && cd ." E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function
ncnn::create_gpu_instance()':
/home/yukino/下载/ncnn/src/gpu.cpp:1555: undefined reference to glslang::InitializeProcess()' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function
ncnn::destroy_gpu_instance()':
/home/yukino/下载/ncnn/src/gpu.cpp:1569: undefined reference to glslang::FinalizeProcess()' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libncnn.a(gpu.cpp.o): In function
ncnn::compile_spirv_module(char const, int, ncnn::Option const&, std::ndk1::vector<unsigned int, std::ndk1::allocatorglslang::TShader::TShader(EShLanguage)' /home/yukino/下载/ncnn/src/gpu.cpp:3753: undefined reference to
glslang::TShader::setStringsWithLengths(char constglslang::TShader::addProcesses(std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > const&)' /home/yukino/下载/ncnn/src/gpu.cpp:3757: undefined reference to
glslang::TShader::setEntryPoint(char const)'
/home/yukino/下载/ncnn/src/gpu.cpp:3758: undefined reference to `glslang::TShader::setSourceEntryPoint(char const)'
/home/yukino/下载/ncnn/src/gpu.cpp:3778: undefined reference to glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)' /home/yukino/下载/ncnn/src/gpu.cpp:3792: undefined reference to
glslang::TShader::~TShader()'
/home/yukino/下载/ncnn/src/gpu.cpp:3782: undefined reference to glslang::TShader::getInfoLog()' /home/yukino/下载/ncnn/src/gpu.cpp:3782: undefined reference to
glslang::TShader::getInfoLog()'
/home/yukino/下载/ncnn/src/gpu.cpp:3783: undefined reference to glslang::TShader::getInfoDebugLog()' /home/yukino/下载/ncnn/src/gpu.cpp:3783: undefined reference to
glslang::TShader::getInfoDebugLog()'
/home/yukino/下载/ncnn/src/gpu.cpp:3792: undefined reference to glslang::TShader::~TShader()' /home/yukino/下载/ncnn/src/gpu.cpp:3792: undefined reference to
glslang::TShader::~TShader()'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function glslang::GlslangToSpv(glslang::TIntermediate const&, std::__ndk1::vector<unsigned int, std::__ndk1::allocator<unsigned int> >&, spv::SpvBuildLogger*, glslang::SpvOptions*)': /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:8959: undefined reference to
glslang::GetThreadPoolAllocator()'
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:8959: undefined reference to glslang::TPoolAllocator::push()' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
pool_allocator':
/home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/PoolAlloc.h:280: undefined reference to glslang::GetThreadPoolAllocator()' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
TGlslangToSpvTraverser':
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:1451: undefined reference to glslang::GetKhronosToolId()' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
glslang::GlslangToSpv(glslang::TIntermediate const&, std::ndk1::vector<unsigned int, std::ndk1::allocatorglslang::GetThreadPoolAllocator()' /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:8987: undefined reference to
glslang::TPoolAllocator::pop()'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function (anonymous namespace)::TGlslangToSpvTraverser::visitBinary(glslang::TVisit, glslang::TIntermBinary*)': /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:1975: undefined reference to
glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)'
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:2070: undefined reference to glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)' /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:2055: undefined reference to
glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function (anonymous namespace)::TGlslangToSpvTraverser::collectRayTracingLinkerObjects()': /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4715: undefined reference to
glslang::TIntermediate::findLinkerObjects() const'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function pool_allocator': /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/PoolAlloc.h:280: undefined reference to
glslang::GetThreadPoolAllocator()'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function glslang::pool_allocator<char>::allocate(unsigned long)': /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/PoolAlloc.h:288: undefined reference to
glslang::TPoolAllocator::allocate(unsigned long)'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function (anonymous namespace)::TGlslangToSpvTraverser::decorateStructType(glslang::TType const&, glslang::TVector<glslang::TTypeLoc> const*, glslang::TLayoutPacking, glslang::TQualifier const&, unsigned int)': /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4151: undefined reference to
glslang::TIntermediate::computeTypeLocationSize(glslang::TType const&, EShLanguage)'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function (anonymous namespace)::TGlslangToSpvTraverser::updateMemberOffset(glslang::TType const&, glslang::TType const&, int&, int&, glslang::TLayoutPacking, glslang::TLayoutMatrix)': /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4507: undefined reference to
glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4527: undefined reference to glslang::TIntermediate::improperStraddle(glslang::TType const&, int, int)' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
(anonymous namespace)::TGlslangToSpvTraverser::getMatrixStride(glslang::TType const&, glslang::TLayoutPacking, glslang::TLayoutMatrix)':
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4464: undefined reference to glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
(anonymous namespace)::TGlslangToSpvTraverser::getArrayStride(glslang::TType const&, glslang::TLayoutPacking, glslang::TLayoutMatrix)':
/home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4447: undefined reference to glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)' /home/yukino/下载/ncnn/glslang/SPIRV/GlslangToSpv.cpp:4447: undefined reference to
glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function glslang::TArraySizes::operator new(unsigned long)': /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/arrays.h:223: undefined reference to
glslang::GetThreadPoolAllocator()'
/home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/arrays.h:223: undefined reference to glslang::TPoolAllocator::allocate(unsigned long)' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
glslang::TVectorglslang::GetThreadPoolAllocator()' /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/Include/Common.h:177: undefined reference to
glslang::TPoolAllocator::allocate(unsigned long)'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function pool_allocator': /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/MachineIndependent/../Include/PoolAlloc.h:280: undefined reference to
glslang::GetThreadPoolAllocator()'
E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function glslang::NewPoolTString(char const*)': /home/yukino/下载/ncnn/glslang/SPIRV/../glslang/Include/Common.h:158: undefined reference to
glslang::GetThreadPoolAllocator()'
/home/yukino/下载/ncnn/glslang/SPIRV/../glslang/Include/Common.h:158: undefined reference to glslang::TPoolAllocator::allocate(unsigned long)' E:/YOLOv5_NCNN-master/YOLOv5_NCNN-master/android_YOLOV5_NCNN/app/src/main/cpp/ncnnvulkan/arm64-v8a/libSPIRV.a(GlslangToSpv.cpp.o): In function
glslang::pool_allocator
不好确定,用的版本是1年多前的版本,有空再看看。你可以先看看修改 CMakeLists.txt 能不能解决。参考前面工程的写法。ncnnvulkan的文件夹整体路径格式可能也要变。
直接删除ncnnvulkan里面的内容,并下载编译好的官方ncnn库,解压直接放入工程。先试下工程能不能正常运行。YoloV5CustomLayer.h 里面设置为 0 。已经改成可以用最新的官方库了,需要修改下 CMakeLists.txt 。正常运行后再用自己编译的库尝试下。
CMakeLists.txt 修改后的 CMakeLists.txt
替换为自己编译的ncnn,再打开YoloV5CustomLayer.h 里面设置为 1,可以正常使用YoloV5CustomLayer了。 谢谢dalao!!
虽然能够正常使用YoloV5CustomLayer了,但是还是不能用自己按照nihui大佬的教程https://zhuanlan.zhihu.com/p/275989233?utm_source=qq 训练出来的模型替换(修改了项目中的.cpp和.h文件,包括labels和output)。
观察模型文件发现不管是nihui大佬的还是项目中的.param 文件中都有HardSwish 和 ReLU层,以及yolov5项目中export.py文件中也含有相关的语句
if isinstance(m.act, nn.Hardswish):
m.act = Hardswish()
elif isinstance(m.act, nn.SiLU):
m.act = SiLU()
但是自己最后的模型文件只有Swish层且没有ReLU层,这是最主要的差别。
请问这会是onnx导出过程中的问题吗?
问题解决了!原来是修改labels的时候,错误修改了.h文件,应该修改java目录下的box文件。 修改了labels和.h文件里面的三个output,就可以使用自己的模型文件进行预测了!完美 再次感谢dalao的无私帮助!respect!
问题解决了!原来是修改labels的时候,错误修改了.h文件,应该修改java目录下的box文件。 修改了labels和.h文件里面的三个output,就可以使用自己的模型文件进行预测了!完美 再次感谢dalao的无私帮助!respect!
替换自己的YoloV5CustomLayer是下面的步骤吗: 1.下载[cmdbug]dalao的工程,ncnnvulkan是已经编译好了还是需要重新去官网下载并编译?2.修改YoloV5CustomLayer.param的output和.h 里面设置为 1,3.运行安卓工程。 问题:opencv是怎么删除的?我安装作者YoloV5CustomLayer.h文件里面的说明总是报错,[yukinolove8]能不能说明一下实现步骤。
问题解决了!原来是修改labels的时候,错误修改了.h文件,应该修改java目录下的box文件。 修改了labels和.h文件里面的三个output,就可以使用自己的模型文件进行预测了!完美 再次感谢dalao的无私帮助!respect!
替换自己的YoloV5CustomLayer是下面的步骤吗: 1.下载[cmdbug]dalao的工程,ncnnvulkan是已经编译好了还是需要重新去官网下载并编译?2.修改YoloV5CustomLayer.param的output和.h 里面设置为 1,3.运行安卓工程。 问题:opencv是怎么删除的?我安装作者YoloV5CustomLayer.h文件里面的说明总是报错,[yukinolove8]能不能说明一下实现步骤。
看一下后一个issue。ncnn编译可以去看官方项目页面的how to build
注释写到工程中如果需要使用YOLOV5_CUSTOMLAYER得重新编译ncnn,具体该怎么做呢?