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

AttributeError: 'tuple' object has no attribute 'size' #40

Open
OpenAI-chn opened this issue Mar 28, 2022 · 1 comment
Open

AttributeError: 'tuple' object has no attribute 'size' #40

OpenAI-chn opened this issue Mar 28, 2022 · 1 comment

Comments

@OpenAI-chn
Copy link

np.array(output.size()[1:], dtype=np.int32))

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

@Beta-Hu
Copy link

Beta-Hu commented Aug 11, 2022

I have meet the same problem today, and it may caused by a MaxPool2d operation with argument return_indices=True, because when requires indices, MaxPool2d will return a tuple, rather than a Tensor when return_indices=False.
这可能是因为你将MaxPool2d的参数return_indices设置为了True,此时MaxPool2d返回的是一个包含池化结果和下标的元组。

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