Tfjs: Data type issue in Chromium 61 / Electron

Created on 4 May 2018  路  5Comments  路  Source: tensorflow/tfjs

To get help from the community, check out our Google group.

TensorFlow.js version

tfjs-core 0.9.0
tfjs-converter 0.2.1

Browser version

Chromium 61.0.3163.100
Electron 2.0.0

Describe the problem or feature request

Receive the following error when executing a model:
Uncaught (in promise) Error: Error in conv2D: Either strides or dilations must be 1.Got strides 2,2 and dilations '1,1'

^ in the above case dilations was an array of [Long(1), Long(1)]
whereas in Chrome 66 with the same model it is an array of [1,1]

I noticed that setting util.Long to null in tf-jsconverter:1858 fixed the issue in Chromium 61.
And that util.Long(1) === 1 returns false. (which seems wrong?) this is used in tfjs-core line 8919

function tupleValuesAreOne(param) {
var _a = parseTupleParam(param), dimA = _a[0], dimB = _a[1];
return dimA === 1 && dimB === 1;
}
^ This returns false for [Long(1), Long(1)]

Code to reproduce the bug / link to feature request

Sorry, I don't have code to reproduce. The above version of chrome and tfjs should reproduce when using a conv2D.

converter bug

All 5 comments

Looks like Ping already fixed this in tensorflow/tfjs-converter#113.

That fix was included in tfjs-converter 0.3.1 so you should be good to go. Thanks for the report!

Still getting this issue.

Uncaught (in promise) Error: Error in conv2D: Either strides or dilations must be 1.Got strides 2,2 and dilations '1,1'
    at Object.a [as assert] ([email protected]:1)
    at e.conv2d ([email protected]:1)
    at [email protected]:1
    at Object.e.tidy ([email protected]:1)
    at Object.n.value [as conv2d] ([email protected]:1)
    at Object.a.executeOp ([email protected]:1)
    at Object.a.executeOp ([email protected]:1)
    at [email protected]:1
    at Array.reduce (<anonymous>)
    at [email protected]:1

HTML

<script src="../lib/[email protected]"></script>
<script src="../lib/[email protected]"></script>

JS

this.model = await tf_converter.loadFrozenModel(MODEL_URL, WEIGHTS_URL);
this.model.execute(input_dict, OUTPUT_NODE_NAME);

@jeffpyke can you confirm if the latest version has fixed this issue? Thanks!

Cool, yes, I can confirm the issue I saw above is fixed on tensorflow core 0.11.7, tensorflow converter 0.4.1, and electron 2.0.2!

Was this page helpful?
0 / 5 - 0 ratings