hpi-xnor / BMXNet

(New version is out: https://github.com/hpi-xnor/BMXNet-v2) BMXNet: An Open-Source Binary Neural Network Implementation Based on MXNet
Apache License 2.0
349 stars 95 forks source link

How to integrate a trained binary model in iOS? #46

Closed haithanhp closed 5 years ago

haithanhp commented 6 years ago

Hi,

Thanks for your great work! I try to retrain resnet 18 binary on imagenet. I can convert weight to binary storage by using model_convert function. However, when I use that model run on iOS, it does not work. Also, I try to run amalgamate_mxnet_mac.sh but it gives an error: "fatal error: src/ndarray/autograd.cc: No such file or directory". I run everything in Linux Ubuntu (except to iOS app in macOS). Could you show me the step by step to build everything on iOS.

Thanks, Hai

yanghaojin commented 6 years ago

Hi, did you check the two application projects offered by @mtin ? https://github.com/hpi-xnor/ios-image-classification https://github.com/hpi-xnor/ios-mnist

haithanhp commented 6 years ago

Hi,

Yes, I tried the two above applications and they work. But I want to re-train a binarized models on ImageNet and integrate to iOS. My current re-trained models get crash when doing prediction? So Could you show me how to train a binary network using BMXNet and integrate to iOS?

Thanks, Hai

yanghaojin commented 6 years ago

just one possible tip: pls use "uint32" as the BINARY_WORD_TYPE, compiling the project and using model converter to recreate the binarized model. This may solve your crashing problem in iOS prediction.