Model Loading And/Or SqueezeNet Assets Bug
Created by: StanislawAntol
I have not had the time to look in-depth into the source code, but I think I found a bug.
If one replaces original test program with my test program and use the the SqueezeNet model in the Android examples directory, which is slightly different than the one in the test directory, there is a segfault:
Android
directory SqueezeNet Model:
Starting program: /tmp/baidu/mobile-deep-learning/build/release/x86/build/mdlTest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
main(): start running cycle : 0
initialize(0): Start
predict(0): Load time : 21.945ms
initialize(0): End
predict(0): Start
predict(0): Total time: 243.052ms.
predict(0): End
destruct(0): Start
destruct(0): Deleting gemmer 0
destruct(0): End
main(): end running cycle : 0
main(): start running cycle : 1
initialize(1): Start
predict(1): Load time : 11.301ms
initialize(1): End
predict(1): Start
Program received signal SIGSEGV, Segmentation fault.
0x000000000042f6b8 in mdl::PoolingLayer::forward_max() ()
(gdb) bt
#0 0x000000000042f6b8 in mdl::PoolingLayer::forward_max() ()
#1 0x000000000041a622 in mdl::Net::forward_from_to(float*, int, int, bool) ()
#2 0x000000000041aaee in mdl::Net::predict(float*) ()
#3 0x000000000040f849 in predict(int, int) [clone .constprop.65] ()
#4 0x000000000040e8d2 in main ()
versus using the test
directory SqueezeNet Model:
Starting program: /tmp/baidu/mobile-deep-learning/build/release/x86/build/mdlTest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
main(): start running cycle : 0
initialize(0): Start
predict(0): Load time : 22.86ms
initialize(0): End
predict(0): Start
predict(0): Total time: 257.916ms.
predict(0): End
destruct(0): Start
destruct(0): Deleting gemmer 0
destruct(0): End
main(): end running cycle : 0
main(): start running cycle : 1
initialize(1): Start
predict(1): Load time : 10.725ms
initialize(1): End
predict(1): Start
predict(1): Total time: 235.263ms.
predict(1): End
destruct(1): Start
destruct(1): Deleting gemmer 0
destruct(1): End
main(): end running cycle : 1
main(): start running cycle : 2
initialize(2): Start
predict(2): Load time : 10.755ms
initialize(2): End
predict(2): Start
predict(2): Total time: 236.831ms.
predict(2): End
destruct(2): Start
destruct(2): Deleting gemmer 0
destruct(2): End
main(): end running cycle : 2
[Inferior 1 (process 9200) exited normally]
A simple fix might be to update the Android
SqueezeNet model to be the same as the test
one, but this might just hide a bug with how the library is loading/creating models. Perhaps someone more familiar with the source would have a better idea if this is actually a bug.
Thanks!