question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tfjs 2.8.0 is broken and introduces regressions in tf.image.cropAndResize

See original GitHub issue

As 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:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lina128commented, Dec 16, 2020

Hi @vladmandic, we are going to release the fix in 2.8.1 very soon.

0reactions
vladmandiccommented, Dec 18, 2020

tfjs 2.8.1 fixes this issue, but exposes another issue in #4429

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found