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

Unable to load asset #78

Open
malder08 opened this issue Dec 6, 2019 · 6 comments
Open

Unable to load asset #78

malder08 opened this issue Dec 6, 2019 · 6 comments

Comments

@malder08
Copy link

malder08 commented Dec 6, 2019

I'm using the recognizeBinaryImage and imageToByteListFloat32 function from the example in conjunction with the imagePicker function where I pass in the selected image file from another screen. When running the recognizeBinaryImage function, an error is thrown at this line:
var imageBytes = (await rootBundle.load(image.path)).buffer;
The error I receive is
Unable to load asset: /storage/emulated/0/Android/data/com.example.tensorflow_image_classification_gci/files/Pictures/20191205_133618.jpg
Another thoughts on what the problem could be?

@mtkgeek
Copy link

mtkgeek commented Dec 20, 2019

I'm having this issue too. Any help will be appreciated

@malder08
Copy link
Author

@mtkgeek Are you having this issue when using the default model? If you are, I was unfortunately never able to get it working with the default model but when I switched over to the ssd mobilenet model it was working fine. I'm not entirely sure what was causing it not to work with the default model but try using a different model and see if that works for you

@mtkgeek
Copy link

mtkgeek commented Dec 21, 2019

@malder08 I'm using an automl vision pretrained model and i think it's quantized. I guess tflite still has issues working with quantized models. Thanks anyways.

@Ehtasha
Copy link

Ehtasha commented Feb 10, 2020

@malder08 @mtkgeek Did you guys resolve this problem ?
I'm also facing this problem.

@malder08
Copy link
Author

@Ehtasha If you are using the default model, then I never got around to fixing the problem. Unless you have to, I would just use another model like the ssd mobilenet model.

@jherkyesse
Copy link

@malder08
this is my workaround. hope it would help you

import 'dart:io' as Io;
var imageBytes = Io.File(image.path).readAsBytesSync();

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

4 participants