[tfjs-tflite] ERROR: failed to delegate CONV_2D node #2
See original GitHub issueSystem information
- OS Platform and Distribution: Ubuntu 20.04
- Browser version: Chrome 92
The following code fails with a bunch of errors:
<img id="imgInputEl" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBOgE6AAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMACgcHCAcGCggICAsKCgsOGBAODQ0OHRUWERgjHyUkIh8iISYrNy8mKTQpISIwQTE0OTs+Pj4lLkRJQzxINz0+O//bAEMBCgsLDg0OHBAQHDsoIig7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O//AABEIADIAMgMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAABQIDBgQHAf/EACwQAAEDAwIEBAcBAAAAAAAAAAEAAgMEBREhMQYSQVEVMmFxFBYzUoGRwdH/xAAaAQACAwEBAAAAAAAAAAAAAAACBAABBQMG/8QAIhEAAgEEAgIDAQAAAAAAAAAAAAECAwQREhMhBTEUIiNB/9oADAMBAAIRAxEAPwD0LCg9zY28zzgKzC566MmE9Mjfslry6+PDKWWwqVPd9kYaymqZHRxSAvbqW9VN72McGueATsCd1jbnNLSVbJ6dxZLEc8w6rR2yqN1t0dZI0AvadB6EhILyj4dtfsNStMPOei/xCkM4gMwa86AHTKvIWR4hp+WNxHuEx4TvDrjRPp53F09Ppk7ub0P8TFjfO46muwK9vpHaPod8qFPCFqCh0t3GVyXGXEZwuzGiV3IvMTmgarB8tssP+DdukzK3BwlkcAn9gcGcP0zR0Ys/VERnkJAc84z2T+hqKYwNp6c4EbAMd/VZEqc+FzXpGlOSwonDesPgdnfKS8HvdDxIYx5ZInNP41/icXd2GEeqS2BwhvxlzoyMn96f6mPGNqogay/FnoOUJX4kEL1W6MbRj8KmrpI6mIsdlpI8zdwrQdVI7IKkIzWJLKCjJrtGa+UKY1BlkqJ5SfvcNPZdkPD1NC4OjLg4bHKbFfRsg4YJYx0Hyyb9mbulkrZQfh3ROHZ+Qk9v4Ur4J5JZZGBzzqGnOB2C3TlURqudG0pUnmKCnXnJatiIWWXH1ChPEJrSJw2ZeFNyEKMpFZ3Uh5UIUYSIuVbkIVopkEIQrBP/2Q==">
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.8.0/dist/tf.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.4/dist/tf-tflite.js"></script>
<script>
(async function() {
const esrgan = await tflite.loadTFLiteModel('https://tfhub.dev/captain-pool/lite-model/esrgan-tf2/1');
console.log("esrgan:", esrgan);
const outputTensor = tf.tidy(() => {
let img = tf.browser.fromPixels(imgInputEl);
let input = tf.sub(tf.div(tf.expandDims(img), 127.5), 1); // normalise [-1,1]
console.log("input:", input);
let outputTensor = esrgan.predict(input);
return tf.mul(tf.add(outputTensor, 1), 127.5) // de-normalize
});
console.log(outputTensor, outputTensor.shape);
})();
</script>
…
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Request to have ConvLSTM2D for TFLite #38220 - GitHub
java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Attempting to use a delegate that only supports static-sized ...
Read more >TFLite Converter: Conv2D error when converting
Here is the code snippet I used: converter = tf.lite.TFLiteConverter.from_saved_model(self.tf_model_path) ...
Read more >tensorflow/tfjs-node: Error: Failed to load SavedModel: Op ...
The error received is due to the lack of ops available on raspberry pi when loading a desktop compiled model (with higher ops...
Read more >Hexagon delegate on RB5 - Qualcomm Developer Network
I've tried to run a tflite model with hexagon delegate on Qualcomm RB5. ... ERROR: Node number 31 (TfLiteHexagonDelegate) failed to prepare.
Read more >Use Coral Edge TPUs to run TFlite models in Node with ...
A fully working version of this Codelab is available in the sig-tfjs GitHub repo. Do I need a Coral Device? No. You can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you guys for investigation. Actually tfjs-tflite@0.0.1-alpha.4 is indeed the latest version. The errors shown here are from the tflite c++ runtime. It is likely that the model is not working well with XNNPACK that tflite is using. I will do more digging with the tflite team and report back if I have anything. Thank you!
Hi, I just published a new version of the
tfjs-tflite
package (0.0.1-alpha.6) which should fix this problem. See this demo. The model is a little bit slow but it works:) It might get a bit faster if you set up your server for cross-origin isolation (codepen doesn’t support it unfortunately).Thanks!