In Flutter (VS Studio 2022) I am trying to use a .tflite model. This is my pubspec.yaml file;
name: linked_post_ai_v1
description: A description about your project.
version: 1.0.0
environment:
sdk: '^3.2.0-65.0.dev'
dependencies:
flutter:
sdk: flutter
path_provider: ^2.0.11
sqflite: ^2.0.0
http: ^1.1.0
tflite_flutter: ^0.10.1
dev_dependencies:
flutter_lints: ^1.0.4
sqflite_common_ffi: ^2.3.0+2
flutter:
uses-material-design: true
assets:
- assets/distilgpt2-small-64-fp16.tflite
This is my folder structure:
root
-assets
-lib
--pubspec.yaml
--other.dart files
The model I want to use is in the assets folder, I checked the path a gazillion times by now. I tried other models too so I dont think the file is the problem. I tried about anything I could think of. Still getting this error:
The asset file 'assets\distilgpt2-small-64-fp16.tflite' doesn't exist.
Try creating the file or fixing the path to the file.
I also tried \ and / in the path, neither work.
Any suggestions?
can you please try removing the '-' from your file name?
It worked when I faced this issue.