Comments (6)
Hi @prakashssp077, Can you please share some reproducible code.
from tflite_flutter_helper.
I had this when I tried to run PoseNet on an image, the precondition fails where inputTensor bytelength is 4x the input byte's length.
from tflite_flutter_helper.
It seems that when loading the model from asset, _tensor
in interpreter.dart
already has 4x the number of bytes and trying to resizeInputTensor
fails
from tflite_flutter_helper.
@am15h Actually I am getting a similar error, even without doing anything.
I/tflite ( 5512): Initialized TensorFlow Lite runtime.
I/flutter ( 5512): Interpreter Created Successfully
I/flutter ( 5512): Labels loaded successfully
I/flutter ( 5512): Time to load image: 51 ms
E/tflite ( 5512): tensorflow/lite/kernels/reshape.cc:66 num_input_elements != num_output_elements (4004 != 1001)
E/tflite ( 5512): Node number 29 (RESHAPE) failed to prepare.
E/flutter ( 5512): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Bad state: failed precondition
E/flutter ( 5512): #0 checkState (package:quiver/check.dart:74:5)
E/flutter ( 5512): #1 Interpreter.allocateTensors (package:tflite_flutter/src/interpreter.dart:142:5)
E/flutter ( 5512): #2 Interpreter.runForMultipleInputs (package:tflite_flutter/src/interpreter.dart:181:7)
E/flutter ( 5512): #3 Interpreter.run (package:tflite_flutter/src/interpreter.dart:157:5)
E/flutter ( 5512): #4 Classifier.predict (package:imageclassification/classifier.dart:97:17)
E/flutter ( 5512): #5 _MyHomePageState._predict (package:imageclassification/main.dart:67:28)
E/flutter ( 5512): #6 _MyHomePageState.getImage.<anonymous closure> (package:imageclassification/main.dart:61:7)
E/flutter ( 5512): #7 State.setState (package:flutter/src/widgets/framework.dart:1088:30)
E/flutter ( 5512): #8 _MyHomePageState.getImage (package:imageclassification/main.dart:57:5)
E/flutter ( 5512): <asynchronous suspension>
E/flutter ( 5512):
Steps to reproduce:
- clone the repository
- run sh install.sh from example/image_classification
- build example/image_classification on Android emulator
- load any image from the emulator by tapping the bottom right button
from tflite_flutter_helper.
Ok false alarm, I had changed the package code and had to repair it using
flutter pub cache repair
from tflite_flutter_helper.
@yaizudamashii were you able to solve the above error of failed precondition
from tflite_flutter_helper.
Related Issues (20)
- Precondition failed when attempting to use with a custom model HOT 11
- ImageProcessor doesn't run through tasks during process since 0.3.1 HOT 1
- install.bat didn't wok
- squeeze TensorBuffer HOT 1
- preNormalize question
- LateInitializationError: Field 'bertQuestionAnswerer' has not been initialized. HOT 1
- Model doesnt work with the plugin HOT 1
- Flutter 3.0 error HOT 16
- Error when trying to use the tflite_flutter_helper package HOT 12
- Cannot find an axis to label. A valid axis to label should have size larger than 1.
- Issue while debugging.
- Bad state: failed precondition with TensorFlow Lite v3
- Get exception in interpreter.run
- not compatible with ffi 2.0.1. HOT 2
- TensorLabel from tflite file
- _outputBuffer.getDoubleList() value is low
- Could not find method compile() for arguments
- Upgrade Image Dependency HOT 15
- Why package is DISCONTINUED ? HOT 5
- A value of type 'ImageData?' can't be assigned to a variable of type 'List<int>?'. Try changing the type of the variable, or casting the right-hand type to 'List<int>?'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tflite_flutter_helper.