Caffe2-iOS icon indicating copy to clipboard operation
Caffe2-iOS copied to clipboard

How to use other model?

Open liu6381810 opened this issue 7 years ago • 3 comments

I have MobileNetInit.pb and MobileNetPredict.pb in the models directory, but when I build this project, I got the error 'try!' expression unexpectedly raised an error: Error Domain=Caffe2 Code=1 "File named "mobileNetPredict.pb" not found in main bundle" So how to use my model other than YOLO and Squeezenet

liu6381810 avatar Jun 30 '17 09:06 liu6381810

@liu6381810 Hey, when you drag those model in, make sure you check the target Membership include this app. Also, if it's build-in, you may wanna add this in here with same naming convention.

KleinYuan avatar Jul 01 '17 04:07 KleinYuan

@KleinYuan Thanks for your reply, I have drag my model in the target and build successfully. But when I add statement to the function classifier in staticDetectorVC.swift like this var caffe = try! Caffe2(initNetNamed: "squeezeNetInit", predictNetNamed: "squeezeNetPredict") it runs well, and if let result = caffe.prediction(regarding: resizedImage!) get desired result of dim 1000, but when I changed the squeezeNet to tinyYolo ,the result dim is very large, and all the value is non, and when I use my own model, it just get an error Thread 1: signal SIGABRT at _predictor = new caffe2::Predictor(_initNet, _predictNet); so how can I fix it? I would appreciate it if you can help me.

liu6381810 avatar Jul 03 '17 02:07 liu6381810

@liu6381810 ok, I guess you mentioned multiple issues.

But to the point of Thread 1: signal SIGABRT, I believe it's because of the google protocol memory size limit.

I guess your own model is larger than 64MB right?

Check this

For the issue of Yolo Output Nan, it's related to this issue

So, so far in this repo, I only output whatever the results give. To actually build a Yolo on Caffe2 project, we need some wrapper like this to actually visualize the bounding box.

I will try to add this soon.

KleinYuan avatar Jul 03 '17 04:07 KleinYuan