Skip to content

program stop at nn.Conv2d(...) #573

Open
@EsakaK

Description

@EsakaK

When I start 'python train.py', the process stopped at position'***', which meant it output 1 but no further output 2. I am puzzled with the problem in 'nn.Conv2()' . Why the problem comes up with that and How can I solve it?

def vgg(cfg, i, batch_norm=False):
    layers = []
    in_channels = i
    for v in cfg:
        if v == 'M':
            layers += [nn.MaxPool2d(kernel_size=2, stride=2)]
        elif v == 'C':
            layers += [nn.MaxPool2d(kernel_size=2, stride=2, ceil_mode=True)]
        else:
            print('1')
            *** conv2 = nn.Conv2d(in_channels, v, kernel_size=3, padding=1)
            print('2')
            if batch_norm:
                layers += [conv2, nn.BatchNorm2d(v), nn.ReLU(inplace=True)]
            else:
                layers += [conv2, nn.ReLU(inplace=True)]
            in_channels = v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions