Closed rkuo2000 closed 3 years ago
Can you please share a Notebook of this?
you can download tinyml-ecg.ipynb from https://www.kaggle.com/rkuo2000/tinyml-ecg on Kaggle also the ECG heartbeat dataset from https://www.kaggle.com/shayanfazeli/heartbeat
I'm getting this error using your code.
GetModel done
Version check done
Didn't find op for builtin opcode 'EXPAND_DIMS' version '1'
Failed to get registration from op code d
Allocation failed
AllocateTensors() failed
Cannot load Tf model
I have revised the python code Version 1. with DNN , the arduino code predict OK Version 2. with Conv1D+Conv1D+Maxpooling1D+DNN, the arduino code did NOT predict Version 3. with Conv1D+DNN, the arduino code did NOT predict Version 4. with Conv2D+DNN (need X_train.reshape(-1, 1, 187,1), predict OK (more code size, 96.18% val accuracy, predict fast 44.1ms) Version 5. with Conv2D+Conv2D+Maxpooling2D+DNN, predict OK (less code size, 97.2 val accuracy, but predict slower 265ms)
it seems Conv1D is not converted to C code correctly ?!
I have revised the python code https://www.kaggle.com/rkuo2000/tinyml-ecg Version 1. with DNN , the arduino code predict OK Version 2. with Conv1D+Conv1D+Maxpooling1D+DNN, the arduino code did NOT predict Version 3. with Conv1D+DNN, the arduino code did NOT predict Version 4. with Conv2D+DNN (need X_train.reshape(-1, 1, 187,1), predict OK (more code size, 96.18% val accuracy, predict fast 44.1ms) Version 5. with Conv2D+Conv2D+Maxpooling2D+DNN, predict OK (less code size, 97.2 val accuracy, but predict slower 265ms)
it seems Conv1D is not converted to C code correctly ?!
eloquentarduino notifications@github.com 於 2021年1月10日 週日 上午12:30寫道:
I'm getting this error using your code.
GetModel done Version check done Didn't find op for builtin opcode 'EXPAND_DIMS' version '1'
Failed to get registration from op code d
Allocation failed AllocateTensors() failed
Cannot load Tf model
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eloquentarduino/EloquentTinyML/issues/16#issuecomment-757331151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TAJFCYX5LWHNRY6UT2KDSZCABDANCNFSM4VVWCGPQ .
-- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
Conv1D is not listed in their supported operators: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/all_ops_resolver.cc
Thanks for your help to clarify it, I have kept my python example code in Conv2D.
@rkuo2000 Bro, I tried to use your code (2D CNN) but I'm getting a prediction of "nan" on the serial monitor. Can I send you my code if you can help me out?
Yes, of course you can.
AhmedElkhamisi @.***> 於 2021年7月26日 週一 上午2:24寫道:
@rkuo2000 https://github.com/rkuo2000 Bro, I tried to use your code (2D CNN) but I'm getting a prediction of "nan" on the serial monitor. Can I send you my code if you can help me out?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eloquentarduino/EloquentTinyML/issues/16#issuecomment-886239920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TAJANVRN667KT237XMQLTZRJE3ANCNFSM4VVWCGPQ .
-- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
It is probably your data issue, I have several Kaggle examples for your reference below: https://www.kaggle.com/rkuo2000/tinyml-airdigit https://www.kaggle.com/rkuo2000/tinyml-ecg https://www.kaggle.com/rkuo2000/tinyml-mnist https://www.kaggle.com/rkuo2000/tinyml-gtsrb https://www.kaggle.com/rkuo2000/tinyml-digit
Richard Kuo @.***> 於 2021年7月26日 週一 上午2:39寫道:
Yes, of course you can.
AhmedElkhamisi @.***> 於 2021年7月26日 週一 上午2:24寫道:
@rkuo2000 https://github.com/rkuo2000 Bro, I tried to use your code (2D CNN) but I'm getting a prediction of "nan" on the serial monitor. Can I send you my code if you can help me out?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eloquentarduino/EloquentTinyML/issues/16#issuecomment-886239920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TAJANVRN667KT237XMQLTZRJE3ANCNFSM4VVWCGPQ .
-- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
-- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
Is the export test data essential?? My project is on ECG too.
@rkuo2000 How do you upload your code to arduino? I used your exact same code but it didn't predict for me.
Please look into https://github.com/rkuo2000/arduino/tree/master/examples TinyML_AirDigit TinyML_Digit TinyML_ECG TinyML_MNIST
upload code into ESP32 (NodeMCU-32S) using Arduino IDE
AhmedElkhamisi @.***> 於 2021年7月26日 週一 上午3:17寫道:
@rkuo2000 https://github.com/rkuo2000 How do you upload your code to arduino? I used your exact same code but it didn't predict for me.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eloquentarduino/EloquentTinyML/issues/16#issuecomment-886245742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TAJDG7EUY6QKQTHNJBZLTZRPLHANCNFSM4VVWCGPQ .
-- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
Please look into https://github.com/rkuo2000/arduino/tree/master/examples TinyML_AirDigit TinyML_Digit TinyML_ECG TinyML_MNIST upload code into ESP32 (NodeMCU-32S) using Arduino IDE AhmedElkhamisi @.***> 於 2021年7月26日 週一 上午3:17寫道: … @rkuo2000 https://github.com/rkuo2000 How do you upload your code to arduino? I used your exact same code but it didn't predict for me. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#16 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TAJDG7EUY6QKQTHNJBZLTZRPLHANCNFSM4VVWCGPQ . -- Richard Kuo (郭子仁) Adjunct Assistant Professor Electrical Engineering Dept., National Taiwan Ocean University +886-972211921
Thanks a lot!
@AhmedElkhamisi did you solved your error? I get many requests of help for NaN values, I will definetly update the examples to clarify how the input should be formatted for Conv2D to work
@rkuo2000 I'm glad you now mastered the TinyML workflow
@eloquentarduino Yes I did! It was a problem with the Arduino code not the python code.
@rkuo2000 Thankyou once again!
@AhmedElkhamisi @rkuo2000 hi, do you have a similar problem like https://github.com/eloquentarduino/EloquentTinyML/issues/50 when transferring the EloquentTnyML examples to your own project? Thanks.
did you solved your error? I get many requests of help for NaN values, I will definetly update the examples to clarify how the input should be formatted for Conv2D to work
@eloquentarduino hi, I am also facing this problem. Could you update an example to clarify how the input should be formatted for Conv2D to work?
Yes, I will create a more detailed guide for the different types of input data.
After I successfully using Kaggle to generate TinyML MNIST and running its Arduino TinyML_MNIST sample code on ESP32 I create another example which is TinyML ECG, it uses Conv1D & MaxPooling1D for ECG heartbeat classification, input_shape=(187, 1) however, it failed to predict using its Arduino TinyML_ECG sample code on ESP32 (NodeMCU32S)
I tried different TENSOR_ARENA_SIZE , 32/64 *1024, still not able to get prediction result, the below message seems not running the model with x_test.h, y_pred are all 0.00 (this ECG num_classes = 5)
Any hint to debug this ?