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.1 change in behavior in tf.reshape causes errors

See original GitHub issue

upon upgrade from 2.7.0 to 2.8.1, my existing app fails with:

Uncaught (in promise) Error: The implicit shape can't be a fractional number. Got 266 / 3
    at Object.inferFromImplicitShape (util_base.ts:328)
    at Object.reshape76 [as kernelFunc] (Reshape.ts:35)
    at kernelFunc3 (engine.ts:590)
    at engine.ts:660
    at Engine.scopedRun (engine.ts:453)
    at Engine.runKernelFunc (engine.ts:657)
    at Engine.runKernel (engine.ts:522)
    at reshape_ (reshape.ts:60)
    at reshape__op (operation.ts:51)

this may be desired behavior, but it breaks several existing models published on tfhub!

e.g, i’m using blazeface where reshape is failing on results of model inference, so not like that can be changed easily:

const [contours, confidence, contourCoords] = this.meshDetector.predict(face);
const coordsReshaped = tf.reshape(contourCoords, [-1, 3]);
let rawCoords = coordsReshaped.arraySync();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lina128commented, Dec 21, 2020

Thanks for the bug report, we will release the fix in 2.8.2 next week.

0reactions
google-ml-butler[bot]commented, Dec 22, 2020

Are you satisfied with the resolution of your issue? Yes No

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creates a tf.Tensor with the provided values, shape and dtype.
Pass a `WebGLData` object and specify a shape yourself. // This makes it possible for TF.js applications to avoid GPU / CPU sync....
Read more >
Tensorflow.js tf.reshape() Function - GeeksforGeeks
js. The tf. reshape() function is used to reshape a given tensor with the specified shape. Parameters: This function has the following ...
Read more >
tensorflow/tfjs-core - UNPKG
n * @param msg A function that returns the message to report when throwing an\n * error. We use a function for performance...
Read more >
tf.cast not changing the dtype ORIGINAL ISSUE:tensorflowjs ...
In case anybody gets the same error, the answer I got from the github repository maintainers is that TFJS right now only supports...
Read more >
@tensorflow/tfjs: Versions | Openbase
Full version history for @tensorflow/tfjs including change logs. ... DEV [Fix a few tests in layers which caused errors on the console, but...
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