OpenNNA2.0 icon indicating copy to clipboard operation
OpenNNA2.0 copied to clipboard

编译Mobilenet demo失败

Open nightlanding opened this issue 1 year ago • 0 comments

非常感谢作者的工作,我因c语言不熟练,复现demo时遇到一些困难。 已经将src下的core和operator文件放入demo文件夹mobilenetv1_128_0.25下,clang编译时出现error如下所示:

opennna_core.c:28:20: error: incompatible function pointer types initializing 'void (*)(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"Example",&OpenNNA_Operator_Example}, opennna_core.c:30:19: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"Conv2d",&OpenNNA_Operator_Conv2d}, opennna_core.c:31:29: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"Depthwise Conv2d",&OpenNNA_Operator_DWConv2d}, opennna_core.c:33:20: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"Padding",&OpenNNA_Operator_Padding}, opennna_core.c:35:20: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"MaxPool",&OpenNNA_Operator_MaxPool}, opennna_core.c:36:20: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"AvgPool",&OpenNNA_Operator_AvgPool}, opennna_core.c:38:18: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"Dense",&OpenNNA_Operator_Dense}, opennna_core.c:40:17: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"ReLU",&OpenNNA_Operator_ReLU}, opennna_core.c:41:18: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"ReLU6",&OpenNNA_Operator_ReLU6}, opennna_core.c:42:22: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"LeakyRelu",&OpenNNA_Operator_LeakyReLU}, opennna_core.c:43:17: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer )' [-Wincompatible-function-pointer-types] {"tanh",&OpenNNA_Operator_tanh}, opennna_core.c:44:20: error: incompatible function pointer types initializing 'void ()(struct layer )' with an expression of type 'void ()(struct layer *)' [-Wincompatible-function-pointer-types] {"Softmax",&OpenNNA_Operator_Softmax},

报错似乎出现在opennna_core.c第26行的算子数组定义处,我按照ChatGPT提示尝试了一些修改都没能成功,想请问问题大概出在哪里,是我的编译过程有问题还是代码需要修改呢?

nightlanding avatar Sep 13 '24 02:09 nightlanding