AttributeError: ‘tuple‘ object has no attribute ‘size‘,AttributeError: ‘function‘ object has no attr

旧的summary加入LSTM之类的会报错,需要用新的summarry

pip install torchinfo

使用方法

from torchinfo import summary
 
model = Resnet(basic_block, [2, 2, 2, 2], 16).cuda()

你可能感兴趣的:(python,pytorch,深度学习,python)