question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'tuple' object has no attribute 'grad'

See original GitHub issue
PYTORCH_TEST_WITH_DYNAMO=1 python test/test_nn.py -k test_AdaptiveAvgPool1d_cuda --verbose

passes with graph break;

PYTORCH_TEST_WITH_DYNAMO=1 python test/test_nn.py -k test_Adaptive --verbose

fails with

test_AdaptiveAvgPool1d_cuda (__main__.TestNN) ... Traceback (most recent call last):
  File "<string>", line 2, in <lambda>
AttributeError: 'tuple' object has no attribute 'grad'
ERROR RUNNING GUARDS <graph break in _backward> /scratch/binbao/work/pytorch/test/test_nn.py:90
  ___guarded_code.valid and
  ___check_type_id(input.grad, 109098144) and
  ___check_tensors(input, input.grad)
NULL ERROR: /scratch/binbao/work/pytorch/torch/csrc/dynamo/eval_frame.c:251

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yanboliangcommented, Dec 13, 2022

Just chat with @desertfire, since this blocks several core test enhancement, I’ll take a look.

0reactions
ezyangcommented, Dec 22, 2022

Not… really?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'tuple' object has no attribute 'grad_fn' · Issue #10
My env is python2.7+pytorch0.3.1. When I try this repo, I face the problem: AttributeError: 'tuple' object has no attribute 'grad_fn'.
Read more >
How to fix AttributeError: 'tuple' object has no attribute 'to'?
Today i faced with problem AttributeError: 'tuple' object has no attribute 'to' I read a data from csv file with 2 columns: Image...
Read more >
'tuple' object has no attribute 'to' in pytorch - vision
I got this error while trying to test CNN model. I already checked type about this error point'variable.
Read more >
Python AttributeError: 'tuple' object has no attribute
AttributeError: 'tuple' object has no attribute. Learn Data Science with. This error occurs when attempting to access the values of a tuple incorrectly....
Read more >
AttributeError: 'tuple' object has no attribute in Python
The Python "AttributeError: 'tuple' object has no attribute" occurs when we access an attribute that doesn't exist on a tuple. To solve the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found