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

Crashing on iOS simulator with new labels/graph #3

Closed
jordanmcadoo opened this issue Nov 12, 2018 · 2 comments
Closed

Crashing on iOS simulator with new labels/graph #3

jordanmcadoo opened this issue Nov 12, 2018 · 2 comments

Comments

@jordanmcadoo
Copy link

Hello! I was very excited to find your plugin. I've forked the repo and tried replacing the graph and labels with my own, but it keeps crashing on iOS. Android seems to be working fine.

Here is my repo:
https://github.com/jordanmcadoo/flutter_tflite

And this is the output upon crash:

Launching lib/main.dart on iPhone XR in debug mode...
Starting Xcode build...
Xcode build done.                                            5.0s
Syncing files to device iPhone XR...
flutter: success
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001052ab29b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000104847735 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001052ab0f5 +[NSException raise:format:] + 197
	3   Foundation                          0x00000001042d6546 +[NSString stringWithUTF8String:] + 78
	4   Runner                              0x00000001027db603 _Z15runModelOnImageP12NSDictionary + 4035
	5   Runner                              0x00000001027d9976 -[TflitePlugin handleMethodCall:result:] + 662
	6   Flutter                             0x0000000102a73b3b __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 115
	7   Flutter                             0x0000000102a8f248 _ZNK5shell21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrIN5blink15Pl<…>
Lost connection to device.
@shaqian
Copy link
Owner

shaqian commented Nov 13, 2018

Hi,

Can you please try changing the output_size from 1000 to 2?
https://github.com/shaqian/flutter_tflite/blob/master/ios/Classes/TflitePlugin.mm#L195

  const int output_size = 2;

I think the app is crashing because the output array only has 2 valid values for the 2 labels, but the app tries to interpret more values which don't have labels. I will take a further look at why this doesn't happen with the mobilenet model.

Thanks for reporting the issue.

Regards,
Qian

@jordanmcadoo
Copy link
Author

Good catch! That resolved my issue. Thanks so much for your help.

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

No branches or pull requests

2 participants