Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

softmax算子支持 #8

Merged
merged 1 commit into from
Dec 10, 2020
Merged

softmax算子支持 #8

merged 1 commit into from
Dec 10, 2020

Conversation

ccw1996
Copy link
Contributor

@ccw1996 ccw1996 commented Dec 8, 2020

  1. 添加softmax算子
  2. 添加softmax测试用例

@ccw1996
Copy link
Contributor Author

ccw1996 commented Dec 8, 2020

测试用例运行结果:

start to run register cpu allocator
AutoKernel plugin inited
function:autokernel_plugin_init executed
start init_tengine
init_tengine done
REPEAT COUNT= 1
Repeat [1] time 3.00 us per RUN. used 3 us
print output data
7.80134e-05 0.000212062 0.000576445 0.00156694 0.00425939 0.0115782 0.0314729 0.0855521 0.232555 0.632149

@lyuchuny3
Copy link
Contributor

Hi, @ccw1996
你提交的softmax 执行 squeezenet网络后,结果出错。

cd autokernel_plugin
export DEBUG_INFO=1
./build/tests/tm_classification -n squeezenet

结果如下

runing AutoKernel im2col_conv ...
runing AutoKernel im2col_conv ...
[INFO]: runing Autokernel halide_avgpool...
[INFO]: runing Autokernel halide_softmax...
current 32.637 ms

Model name : squeezenet
tengine model file : models/squeezenet.tmfile
label file : models/synset_words.txt
image file : images/cat.jpg
img_h, imag_w, scale, mean[3] : 227 227 1 104.007 116.669 122.679

Repeat 1 times, avg time per run is 32.637 ms
max time is 32.637 ms, min time is 32.637 ms
--------------------------------------
116.6267 - "n04487081 trolleybus, trolley coach, trackless trolley"
103.5060 - "n02799071 baseball"
95.7461 - "n02112018 Pomeranian"
91.3066 - "n03662601 lifeboat"
86.8204 - "n04487394 trombone"
--------------------------------------

正确结果是

--------------------------------------
0.2732 - "n02123045 tabby, tabby cat"
0.2676 - "n02123159 tiger cat"
0.1810 - "n02119789 kit fox, Vulpes macrotis"
0.0818 - "n02124075 Egyptian cat"
0.0724 - "n02085620 Chihuahua"
--------------------------------------

@ccw1996
Copy link
Contributor Author

ccw1996 commented Dec 9, 2020

@lyuchuny3 十分抱歉,之前只验证了自己的测试样例,疏忽了。
现在已经修改完成,使用了tm_classification和test_softmax进行测试,均能够得到正确结果。

@lyuchuny3 lyuchuny3 merged commit 51ea0f6 into OAID:main Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants