class ResidualBlocknnCell def __init__self in_channels out_channels stride=1 downsample=None superResidualBlock self__init__ selfconv1 = nnConv2din_channels out_channels kernel_size=3
在创建ResNet实例时,缺少必要的参数'block'和'layers'。需要在实例化时传入这些参数,例如:
net = ResNet(ResidualBlock, [2, 2, 2, 2])
原文地址: https://www.cveoy.top/t/topic/bgpq 著作权归作者所有。请勿转载和采集!