tfjs 2.8.0 is broken and introduces regressions in tf.image.cropAndResize
See original GitHub issueAs subject line says, TFJS 2.8.0 unfortunately seems like a broken version.
First, default parameter in cropAndResize
was unintentionally removed (and apparently just re-added via #4407) which causes quite a lot of errors in existing apps
Second, even when specifying resize method as bilinear
, cropAndResize
FAILS on WebGL
baclend:
Uncaught (in promise) Error: Failed to compile fragment shader.
at createFragmentShader (webgl_util.ts:103)
at GPGPUContext.createProgram (gpgpu_context.ts:280)
at compileProgram (gpgpu_math.ts:93)
at backend_webgl.ts:858
at MathBackendWebGL.getAndSaveBinary (backend_webgl.ts:902)
at MathBackendWebGL.runWebGLProgram (backend_webgl.ts:857)
at Object.cropAndResize3 [as kernelFunc] (CropAndResize.ts:35)
at kernelFunc3 (engine.ts:590)
at engine.ts:660
at Engine.scopedRun (engine.ts:453)
With WebGL code dump highlighting error in
204 setOutput(float(undefined));
IMO, this is is blocking bug - once fixed, TFJS packages should be republished! (and I’m not sure how this passed any level of testing?)
Btw, same code confirmed working after downgrade to tfjs 2.7.0.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
tf.image.cropAndResize throwing "method must be bilinear or ...
As commented above, TensorFlow.js version 2.8.0 seems to have introduced some breaking changes. Workaround (at the time of writing) is to ...
Read more >Creates a tf.Tensor with the provided values, shape and dtype.
Defines a simple logistic regression model with 32 dimensional input // and 3 dimensional output. const x = tf.input({shape: [32]}); ...
Read more >@tensorflow/tfjs - npm
An open-source machine learning framework.. Latest version: 4.1.0, last published: a month ago. Start using @tensorflow/tfjs in your project ...
Read more >Tensorflow.js tf.image.cropAndResize() Function
Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in ...
Read more >How to crop and resize an image using Tensorflow.js tf.image ...
Your image can come from an HTML Canvas, an HTML Image or even from an HTML Video Element. First we convert it to...
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
Hi @vladmandic, we are going to release the fix in 2.8.1 very soon.
tfjs 2.8.1 fixes this issue, but exposes another issue in #4429