Comments (3)
If you are using the current Master branch, there is a bug in getting prob
. The latest 0.4.x-dev
branch should have correct this.
The below code is corrected version.
Line 297 in a039be0
If you want to stay with the current master branch:
After running the model, you may check the raw output to see the value which is in nnom_output_data[0]
.
Since you are using the sigmoid as the final layer, the value will be q0.7 format which means that decimal bit is 7.
So we are expecting the range from 0~127 to represent 0-1.
from nnom.
Thanks you but i check the bug and is only for multiple output and i have try with dev-0.4.x same result
But i have found some value with float model ouput = >0.5 <1 and optimized model = 1
Then i thinks is a other probleme (nnom_output_data[0] return 0 or 127 never other value)
Maybe is only my model loos many accurate with int8 optimization..
#1 Input - - ( 1, 92, 6,) ( 552, 552, 0) 1 - - - - - - -
#2 Conv2D - ReLU - ( 1, 82, 487,) 2.63M ( 552, 39934, 0) 1 1 - - - - - -
#3 MaxPool - - ( 1, 41, 487,) ( 39934, 19967, 0) 1 1 1 - - - - -
#4 Conv2D - ReLU - ( 1, 35, 20,) 2.38M ( 19967, 700, 0) 1 - 1 - - - - -
#5 MaxPool - - ( 1, 17, 20,) ( 700, 340, 0) 1 1 1 - - - - -
#6 Flatten - - ( 340, ) ( 340, 340, 0) - - 1 - - - - -
#7 Dense - Sigmoid - ( 1, ) 340 ( 340, 1, 680) 1 1 1 - - - - -
#8 Output - - ( 1, ) ( 1, 1, 0) - 1 - - - - - -
I think the Flatten to Dense can be lose many accurate a error of 1 in 340 value can be do a big error
I do test with other model
from nnom.
The 0/127 results might caused by the sigmoid was forced to saturate the output because the num of the integral bit of the dense's output data is > 3, e.g. if int = 4, then the dec bit is 7-4=3. In the cmsis-nn's (also the local backend) tanh and sigmoid, they don't support this number so we have to saturate the output to 1 and 0 (for sigmoid).
You can use model_io_info()
to list the Q format and see if the output of the dense int bit is > 3.
If it dose, there is not much we can do now to get better resolution, unless 16bit or float but they are not yet implemented.
340 to one might cause the value too large. you can try to add another dense with smaller num between.
Or try not to use activation. just use the raw dense output.
from nnom.
Related Issues (20)
- Incosistent Accuracy Between Python and C Implementation HOT 2
- 关于记忆性 HOT 4
- 报错 File "ptq_ns/nnom-master/scripts/nnom.py", line 1019, in generate_model inX += ' ,layer[%d]' % (LI[inp][0]) KeyError: 'tf.__operators__.getitem_5'
- about reshape HOT 3
- 使用了per channel量化和kld量化方法后,出现了多次推理结果不一致的问题
- 关于输出维度的问题 HOT 4
- nnom静态内存支持如何打开? HOT 6
- main_pc.c中的test_x.txt和text_y.txt如何制作?
- 关于识别几秒时长的语音 HOT 3
- inhomogeneous shape after 1 dimensions
- keyword_spotting中的main_pc.c中的test_x.txt和text_y.txt如何制作?
- nothing
- 关于使用DW_Conv2D与Conv2D的移植后使用耗时的问题 HOT 1
- 使用#define NNOM_USING_CMSIS_NN 的错误。 HOT 2
- 运行rnnnoise的example报错 HOT 2
- Error: Deprecated Usage of `np.int` in `to_cstyle` Function in `gen_config.py`
- Keras 3 version compatibility HOT 1
- Installable using pip
- Exception with Tensorflow 2.16 HOT 2
- Consultation on kws examples?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnom.