Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing Custom Tensorflow Operation #11

Closed
tuckerdarby opened this issue May 9, 2017 · 1 comment
Closed

Replacing Custom Tensorflow Operation #11

tuckerdarby opened this issue May 9, 2017 · 1 comment

Comments

@tuckerdarby
Copy link

Hi trigeorgis,

Instead of installing your custom TF repo to gain the custom extract image patches operation, I tried to write the operation in python with TF 1.0. This is what I came up with:

`

        unset_patches = []
        for offset in tf.unstack(inits+dx, axis=1):
            batch_patches = tf.image.extract_glimpse(images, patch_shape, offset)
            unset_patches.append(batch_patches)
        # patches = tf.transpose(unset_patches, (1, 0, 2, 3, 4))
        patches = tf.stack(unset_patches, axis=1)
        patches = tf.reshape(patches, (batch_size * num_patches, patch_shape[0], patch_shape[1], num_channels))`

From here training is able to run, but no learning takes place and losses hover around 1.0 for thousands of steps.

Is there something I'm missing with this? Perhaps the optimizer can't back propagate losses through the operations taking place in python here, or there's an error in the code above when extracting and stacking these patches?

Let me know if you'd like any more information.

Help is greatly appreciated!

@trigeorgis
Copy link
Owner

I began writing some code which does not rely on custom c++ ops that's in https://github.com/trigeorgis/mdm/tree/refactored so you can have a look at that.

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

No branches or pull requests

2 participants