0.14.2
I built a small browser interface for tensorflow js and one of the possible augmentations is random cropping.
Until I decided to update the tfs package from 0.13.5 to 0.14.2 it was working flawlessly, now I am receiving this error:
DataAugComponent.html:42 ERROR TypeError: Cannot read property 'name' of null
at e.runKernel (tf-core.esm.js:17)
at Object.cropAndResize_ [as cropAndResize] (tf-core.esm.js:17)
at randomCrop (image-operations.ts:115)
at DataAugComponent.crop (dataaug.component.ts:36)
at MnistShowCaseComponent.push../src/app/mnist-showcase/mnistshowcase.component.ts.MnistShowCaseComponent.init (mnistshowcase.component.ts:34)
at MnistShowCaseComponent.push../src/app/mnist-showcase/mnistshowcase.component.ts.MnistShowCaseComponent.ngOnChanges (mnistshowcase.component.ts:63)
at checkAndUpdateDirectiveInline (core.js:18616)
at checkAndUpdateNodeInline (core.js:19884)
at checkAndUpdateNode (core.js:19846)
at debugCheckAndUpdateNode (core.js:20480)
export function randomCrop(image: number[], height: number, maxX: number, maxY?: number, width?: number) {
if (width === undefined) {
width = height;
}
if (maxY === undefined) {
maxY = maxX;
}
let norm_x = width - 1;
let norm_y = height - 1;
let y1 = maxY / norm_y;
let x1 = maxX / norm_x;
let y2 = (height - maxY) / norm_y;
let x2 = (width - maxX) / norm_x;
y1 = math.random(0, y1);
x1 = math.random(0, x1);
y2 = math.random(y2, 1);
x2 = math.random(x2, 1);
let bc = tf.image.cropAndResize(
tf.reshape(image, [1, height, width, 1]),
[[y1, x1, y2, x2]],
[0],
[height, width]
);
return Array.from(bc.dataSync());
Am I using it incorrectly, did something change?
Reassigning the issue to people who might have more context about it.
This will be fixed after we release https://github.com/tensorflow/tfjs-core/pull/1506
Alright thanks for the feedback, closing this for now
Most helpful comment
Reassigning the issue to people who might have more context about it.