@ptrblck

main.py

def main():
 train.train()


train.py

 class Network(nn.Module):
    def __init__(self):
        super(Network, self).__init__()
        self.net= nn.Sequential(
            nn.Conv2d(in_channels=3, out_channels=32, kernel_size=5),
            nn.ReLU(),
            nn.MaxPool2d(kernel_size=2),

            nn.Conv2d(in_channels=32, out_channels=48, kernel_size=5),
            nn.ReLU(),
            nn.MaxPool2d(kernel_size=2)
        )

    def forward(self, x):
        x = self.net(x)
        x = x.view(-1, 4 * 4 * 48)  # -1, 7 * 7 * 48
        return x
def trainer():
        model = Network().cuda()

        image1 = np.random.randn(1, 3, 28, 28).astype(np.float32)
        image2 = np.random.randn(1, 3, 28, 28).astype(np.float32)

        input_image = np.vstack([image1, image2])
        input_image = torch.from_numpy(input_image).cuda()
        print(input_image.shape, type(input_image))  # torch.Size([2, 3, 28, 28]) <class 'torch.Tensor'>

        output = model(input_image)
        print(output.shape)

Call train.train() in main.py got Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
and just call train() in train.py, It works.
What the heck!?