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

'NoneType' object has no attribute 'op' #27

Open
siavash-khodadadeh opened this issue Jun 21, 2018 · 1 comment
Open

'NoneType' object has no attribute 'op' #27

siavash-khodadadeh opened this issue Jun 21, 2018 · 1 comment

Comments

@siavash-khodadadeh
Copy link

siavash-khodadadeh commented Jun 21, 2018

I am trying to run the code for my model which uses 3d convolution and fully connected layers.

grads = gradient_memory(train_loss, self.model_variables)
grads = list(zip(grads, self.model_variables))

This should give me the list as

optimizer.compute_grads(train_loss, var_list=self.model_variables)

But instead, I get:

File "gradient_checkpointing.py", line 274, in
inputs_to_do_before = [d_checkpoints[r].op for r in ts]
'NoneType' object has no attribute 'op'

Can you help me with this, please?

I have set the checkpoints equal to ts_all.

@Zettelkasten
Copy link

I got the same error when one of the tensors in checkpoints did not have any gradient (also implicit via checkpoints='speed' or so).
Removing those from checkpoints fixed the issue for me.

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