Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Wrap cropAndResize with an op decorator #1506

Merged
merged 2 commits into from
Jan 24, 2019
Merged

Wrap cropAndResize with an op decorator #1506

merged 2 commits into from
Jan 24, 2019

Conversation

dsmilkov
Copy link
Contributor

@dsmilkov dsmilkov commented Jan 23, 2019

Because we weren't wrapping cropAndResize using the op decorator, a user was seeing this stack trace when executing a model that had cropAndResize as an op:

engine.ts:197 Uncaught (in promise) TypeError: Cannot read property 'name' of null
    at e.runKernel (engine.ts:197)
    at Object.cropAndResize_ [as cropAndResize] (image_ops.ts:296)
    at executeOp$8 (image_executor.ts:65)
    at executeOp$16 (operation_executor.ts:65)
    at p (graph_executor.ts:323)
    at e.processStack (graph_executor.ts:309)
    at e.<anonymous> (graph_executor.ts:294)
    at callbacks.ts:17
    at Object.next (callbacks.ts:17)
    at i (callbacks.ts:17)

This change is Reviewable

@dsmilkov dsmilkov added the BUG label Jan 23, 2019
@dsmilkov dsmilkov requested a review from nsthorat January 23, 2019 21:00
@dsmilkov dsmilkov changed the title Fix Wrap cropAndResize with an op decorator Jan 23, 2019
@timekarma
Copy link

After taking https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.14.2/dist/tf.min.js
I am now getting this error when
loading the Model ok
then error is seen here
const pixels = tf.fromPixels(image);
const res1 = await model.executeAsync(pixels.reshape([1, ...pixels.shape]));

tensor_array.ts:116 Uncaught (in promise) Error: TensorArray : Could not write to TensorArray index 0,
because the value dtype is int32, but TensorArray dtype is float32.
at e.write (tensor_array.ts:116)
at tensor_array.ts:162
at Array.forEach ()
at e.writeMany (tensor_array.ts:162)
at e.scatter (tensor_array.ts:252)
at control_executor.ts:127
at callbacks.ts:17
at Object.next (callbacks.ts:17)
at callbacks.ts:17
at new Promise ()

@timekarma
Copy link

The above error is coming in 0.14.2 release.
In 0.14.1 it works fine. I tested it using the standard object detection example

@nsthorat
Copy link
Contributor

nsthorat commented Feb 2, 2019

@timekarma would you mind filing an issue here: /~https://github.com/tensorflow/tfjs/issues/new

I think this PR is unrelated.

Also, if you could host your model for us to take a look at we can fix it ASAP!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants