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

Cannot find an axis to label. A valid axis to label should have size larger than 1. #60

Open
SmiffyKMc opened this issue May 31, 2022 · 0 comments

Comments

@SmiffyKMc
Copy link

I'm trying to set up my custom hotdog classifier using this library. I have transformed my model to a tflite model and extracted labels [hotdog, nothotdog]. I am able to confirm my input shape is [1, 300, 300, 3] and my output [1, 1]. When I chose the image to predict I'm getting the error:

E/flutter ( 5277): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Invalid argument(s): Cannot find an axis to label. A valid axis to label should have size larger than 1.
E/flutter ( 5277): #0      TensorLabel.getFirstAxisWithSizeGreaterThanOne (package:tflite_flutter_helper/src/label/tensor_label.dart:173:5)
E/flutter ( 5277): #1      new TensorLabel.fromList (package:tflite_flutter_helper/src/label/tensor_label.dart:81:18)
E/flutter ( 5277): #2      Classifier.predict (package:hotdog_classifier/classifier.dart:106:51)
E/flutter ( 5277): #3      _MyHomePageState._predict (package:hotdog_classifier/main.dart:68:28)
E/flutter ( 5277): #4      _MyHomePageState.getImage.<anonymous closure> (package:hotdog_classifier/main.dart:62:7)
E/flutter ( 5277): #5      State.setState (package:flutter/src/widgets/framework.dart:1109:30)
E/flutter ( 5277): #6      _MyHomePageState.getImage (package:hotdog_classifier/main.dart:58:5)

There isn't much documentation to show users how to use their own models for classification. But is anyone able to help me with my issue?

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

1 participant