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

Gradient export #36

Open
ZofiaTr opened this issue Jun 28, 2018 · 2 comments
Open

Gradient export #36

ZofiaTr opened this issue Jun 28, 2018 · 2 comments

Comments

@ZofiaTr
Copy link
Collaborator

ZofiaTr commented Jun 28, 2018

Hi Frederik,

I am testing the class for gradient exporting from TATi. When I run my python code in the terminal, everything works fine, but when I do the same in the jupyter notebook I got this error:

Create model for initial optimization
[<tf.Tensor 'walker1/gradients/walker1/layer1/Wx_plus_b/MatMul_grad/MatMul_1:0' shape=(2, 2) dtype=float32>]
[<tf.Tensor 'walker1/gradients_1/walker1/layer1/Wx_plus_b/add_grad/Reshape_1:0' shape=(2,) dtype=float32>]
[<tf.Tensor 'walker1/gradients_2/walker1/layer2/Wx_plus_b/MatMul_grad/MatMul_1:0' shape=(2, 1) dtype=float32>]
[<tf.Tensor 'walker1/gradients_3/walker1/layer2/Wx_plus_b/add_grad/Reshape_1:0' shape=(1,) dtype=float32>]
[<tf.Tensor 'walker1/gradients_4/walker1/output/Wx_plus_b/MatMul_grad/MatMul_1:0' shape=(1, 1) dtype=float32>]
[<tf.Tensor 'walker1/gradients_5/walker1/output/Wx_plus_b/add_grad/Reshape_1:0' shape=(1,) dtype=float32>]

.....

FailedPreconditionError (see above for traceback): GetNext() failed because the iterator has not been initialized. Ensure that you have run the initializer operation for this iterator before getting the next element.
[[Node: IteratorGetNext = IteratorGetNextoutput_shapes=[[?,2], [?,1]], output_types=[DT_FLOAT, DT_INT32], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Do you have any idea what is going on? It it not critical, I can always run it in the terminal..

@FrederikHeber
Copy link
Collaborator

FrederikHeber commented Jun 28, 2018

As a first guess I would say that you do not reset the dataset iterator, i.e. this needs to happen before calling train().

import tati.models.model as model
...
model.reset_dataset()

Does this help?

@ZofiaTr
Copy link
Collaborator Author

ZofiaTr commented Jun 28, 2018

No. It is the same. I can show it from terminal..

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