We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to use your flutter package for a custom model but I get that my model is not initialised. Is this a regular occurrence?
Let me show you some of my code:
import 'package:pytorch_mobile/pytorch_mobile.dart'; import 'package:pytorch_mobile/model.dart';
I've put pytorch_mobile in my dependencies and added my assets:
assets: - assets/models/[fine-tuning_0.pt](http://fine-tuning_0.pt/) - assets/models/
I put both the actual asset and the directory because it wasn't working, so i just put both, I've tried the combinations and it doesn't work.
@override void initState() { loadPytorchModel().whenComplete(() => log("THIS IS DONE")); Future<void> loadPytorchModel() async { mobileNetModel = await PyTorchMobile.loadModel('assets/models/[fine-tuning_0.pt](http://fine-tuning_0.pt/)'); } Future<void> takePicture() async { image = .... // Ensure that model has been initialised log("this works..."); if (mobileNetModel == null) { await loadPytorchModel(); } List? prediction = await mobileNetModel! .getImagePredictionList(image, decodedImage.width, decodedImage.height);
If I put the if statement checking if the model is null, then nothing happens, if I remove it, I get "mobileNetModel" is uninitialised.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to use your flutter package for a custom model but I get that my model is not initialised. Is this a regular occurrence?
Let me show you some of my code:
I've put pytorch_mobile in my dependencies and added my assets:
I put both the actual asset and the directory because it wasn't working, so i just put both, I've tried the combinations and it doesn't work.
If I put the if statement checking if the model is null, then nothing happens, if I remove it, I get "mobileNetModel" is uninitialised.
The text was updated successfully, but these errors were encountered: