sipeed / TinyMaix

TinyMaix is a tiny inference library for microcontrollers (TinyML).
Apache License 2.0
879 stars 142 forks source link

[build fail] examples/mnist_arduino #2

Closed junhuanchen closed 1 year ago

junhuanchen commented 2 years ago

error file

[.pio/build/pico/src/tm_model.cpp.o] Error 1 [.pio/build/pico/src/main.cpp.o] Error 1

src/tm_model.cpp:66:18: warning: unused variable 'b' [-Wunused-variable]
   66 | {   tm_mdlbin_t* b = (tm_mdlbin_t*)l_buf;
      |                  ^
src/tm_model.cpp: In function 'tm_err_t tm_run(tm_mdl_t*, tm_mat_t*, tm_mat_t*)':
src/tm_model.cpp:113:28: error: invalid conversion from 'const uint8_t*' {aka 'const unsigned char*'} to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive]
  113 |     mdl->layer_body = l_bin+sizeof(tm_mdlbin_t);
      |                       ~~~~~^~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            const uint8_t* {aka const unsigned char*}
src/tm_model.cpp:22:54: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
src/tm_model.cpp:117:9: note: in expansion of macro 'TM_READ_LAYER'
  117 |         TM_READ_LAYER(LAYER_BODY,mdl->layer_body,h->size);
      |         ^~~~~~~~~~~~~
src/tm_model.cpp:120:34: error: invalid conversion from 'uint8_t*' {aka 'unsigned char*'} to 'mtype_t*' {aka 'signed char*'} [-fpermissive]
  120 |             _in.data  = mdl->buf + h->in_oft;
      |                         ~~~~~~~~~^~~~~~~~~~~
      |                                  |
      |                                  uint8_t* {aka unsigned char*}
src/tm_model.cpp:123:30: error: invalid conversion from 'uint8_t*' {aka 'unsigned char*'} to 'mtype_t*' {aka 'signed char*'} [-fpermissive]
  123 |         _out.data = mdl->buf + h->out_oft;
      |                     ~~~~~~~~~^~~~~~~~~~~~
      |                              |
      |                              uint8_t* {aka unsigned char*}
src/tm_model.cpp:135:24: warning: unused variable 'l' [-Wunused-variable]
  135 |             tml_gap_t* l = (tml_gap_t*)(LAYER_BODY);
      |                        ^
src/tm_model.cpp:144:28: warning: unused variable 'l' [-Wunused-variable]
  144 |             tml_softmax_t* l = (tml_softmax_t*)(LAYER_BODY);
      |                            ^
src/tm_model.cpp:148:28: warning: unused variable 'l' [-Wunused-variable]
  148 |             tml_reshape_t* l = (tml_reshape_t*)(LAYER_BODY);
      |                            ^
src/main.cpp: In function 'void setup()':
src/main.cpp:191:17: error: return-statement with a value, in function returning 'void' [-fpermissive]
  191 |         return -1;
      |                 ^
src/main.cpp:200:46: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
  200 |     else TM_PRINTF("tm run error: %d\n", res);
      |                                
Zepan commented 1 year ago

hello, just fixed. and don't use mnist_arduino example for non-ATmega chips, it is special port only for ATmega328.