-
Notifications
You must be signed in to change notification settings - Fork 142
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: 'torch.Size' object has no attribute 'numel' #6
Comments
the same error . |
I fixed this problem. See #8 |
@woaichipinngguo @yaotc I used this file compute_memory.py to replace original |
ConvTranspose2d and Upsample are not supported. @Hansoluo |
@woaichipinngguo "Upsample" layer have no paraments when inference, so inference memory and Flops is zero. "ConvTranspose2d" maybe you can use this math equation to calculate by hand. Or you can use it as same as "Conv2d", just add this layer in script.
|
I used this file compute_memory.py to replace original compute_memory.py. AttributeError: 'torch.Size' object has no attribute 'numel' |
When I use it to test my net, it reports an error:
File "/torchstat/compute_memory.py", line 57, in compute_Conv2d_memory mread = batch_size * (inp.size()[1:].numel() + num_params(module)) AttributeError: 'torch.Size' object has no attribute 'numel'
And I found in pytorch documents torch.numel , only tensor have the attribute 'numel'. So, I have no idea How can I get this to work.If anyone can help, thanks.
I use python 3.5 Pytorch 0.4.1.
The text was updated successfully, but these errors were encountered: