Reputation: 187
I'm trying to load a TFLite model / it's labels into flutter but I keep getting a file not found error. Is it possibly a mistake in my code for loading the model:
Code:
loadModel() async{
String res = await Tflite.loadModel(
model: "lib\assets\image_classifier.tflite",
labels: "lib\assets\image_labels.txt",
);
}
File-Path:
Resource I'm using: https://pub.dev/packages/tflite
Upvotes: 0
Views: 734
Reputation: 101
It's not advicable to put your assets inside you lib directory. Always put at the same level with the lib directory
Upvotes: 0
Reputation: 2082
You should use /
in file path instead of \
loadModel() async{
String res = await Tflite.loadModel(
model: "lib/assets/image_classifier.tflite",
labels: "lib/assets/image_labels.txt",
);
}
Upvotes: 1