0.15.1
Chrome 71.0.3578.98
when I try to run model.detect on a remote image. It says,
Could not write to TensorArray index 0,
because the value dtype is int32, but TensorArray dtype is float32.
However, if I serve the image from a localhost server, it works.
async function init(){
const model = await cocoSsd.load('mobilenet_v2');
let img1 = new Image()
// to bypass cross origin issue
img1.src = `https://i.imgur.com/xFWR5e4.jpg?${Date.now()}`
img1.crossOrigin = ""
img1.onload = async function(){
img1 = tf.image.resizeBilinear(tf.fromPixels(img1), [400, 400]);
const result = await model.detect(img1);
}
}
Also does not works with local file system images, unless I serve them via localhost as well.
I can confirm that I can reproduce the bug and it seems to be a regression between 0.14.1 and 0.14.2
@ritikrishu You can change the script tag that loads tfjs in your program to <script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"> as a workaround in the meantime.
cc @pyu10055
@tafsiri thanks, bro! you saved my day 鉂わ笍
This is fixed in https://github.com/tensorflow/tfjs-core/pull/1577 as part of 1.0
Most helpful comment
I can confirm that I can reproduce the bug and it seems to be a regression between 0.14.1 and 0.14.2
@ritikrishu You can change the script tag that loads tfjs in your program to
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js">as a workaround in the meantime.cc @pyu10055