I’m unable to reproduce the posted error message, but your current code won’t be working since the number of input channels is wrong:
model = Net()
model.eval()
data = torch.randn(1, 3, 24, 24) # Load your data here, this is just dummy data
output = model(data)
> RuntimeError: Given groups=1, weight of size [12, 7, 5, 5], expected input[1, 3, 24, 24] to have 7 channels, but got 3 channels instead

After changing the input channels to 7, you’ll get a shape mismatch error:
data = torch.randn(1, 7, 24, 24) # Load your data here, this is just dummy data
output = model(data)
> RuntimeError: mat1 and mat2 shapes cannot be multiplied (1x4096 and 169744x120)

Changing the in_features to self.fc1 = nn.Linear(4096, 120) works.