My model code:
self.resnet34 = models.resnet34(pretrained=True)
self.fc = nn.Sequential(
def forward(self, x1, x2):
x1 = self.resnet34(x1)
x2 = self.resnet34(x2)
output = torch.cat((x1,x2),1)
output = self.fc(output)
Please help me solving this issue.
Your model itself is working fine as seen here:
model = Classifier()
x1 = torch.randn(1, 3, 224, 224)
x2 = torch.randn(1, 3, 224, 224)
out = model(x1, x2)
Could you post a minimal, executable code snippet which would reproduce the issue or check what the difference between my working example and your code could be?
Thanks for the reply @ptrblck i was taking
torch.max(outputs.data,1) before passing the output to calculate the loss. Now it is resolved.