This could be a bug with the wasm backend, or it could be me doing something silly.
In the following snippet tfjs-bug2 - Replit tfjs proudces garbage output as shown in this screenshot.
Using the WebGL or CPU backend however produces the below screenshot, which is the expected result (see this tfjs-bug - Replit). If this was the cause of using some unsupported op then I’d expect a warning or error logged, but currently nothing out of the ordinary is being written to the console.
Thanks for reaching out and welcome to the forum. So after consulting with the team it seems that you may be using an op that is partially implemented in WASM which is why you do not get an op not supported error - as technically it is supported, but not fully implemented yet so some parameters that are being sent to WebGL version are being thrown away / never used in the WASM version.
It seems your model is composed of the following ops:
This list was generated using your model.json file and then within tfjs-converter directory executing:
yarn model-summary path_to_model_json_file
My understanding is that one of these ops may be “partial” and this is why error is occuring.
For now if you are unable to change code to not use the offending op, your best bet is to force WebGL to ensure it always uses this for execution assuming WebGL is available (which it should be on most regular laptops/smartphones as 97.9% support on CanIUse).
Thank you for the prompt response Jason! Yeah using the webgl backend seems like the way to go. As this is targeted towards smartphones it unfortunately doesn’t solve my problem since on both safari and chrome on iOS it doesn’t run because webgl 2.0 isn’t supported. But that seems like something I’ll just have to wait for until the tensorflowjs webgl backend is more mature.