-
Hi Matt, I'm trying to make a GNN using A part of my network is like this class Encodr(nn.Module):
def __init__(self):
super(Encodr,self).__init__()
self.conv1_out = 8
self.conv2_out = 16
self.fc1_hidden = 10
self.x_lat = 1
self.kernel_size = 5
self.pool_reduce = 'max'
self.conv1 = SplineConv(1, self.conv1_out, dim=2, kernel_size=self.kernel_size)
self.conv2 = SplineConv(self.conv1_out, self.conv2_out, dim=2, kernel_size=self.kernel_size)
self.fc1 = nn.Linear(self.conv2_out, self.fc1_hidden)
self.fc2 = nn.Linear(self.fc1_hidden, self.x_lat)
def forward(self,d):
x_conv1 = F.elu(self.conv1(d.x, d.edge_index0, d.edge_attr0))
x_pool1 = scatter(x_conv1, d.cluster0,dim=0, reduce=self.pool_reduce)
x_conv2 = F.elu(self.conv2(x_pool1, d.edge_index1, d.edge_attr1))
x_pool2 = scatter(x_conv2, d.cluster1, dim=0, reduce=self.pool_reduce)
x_fc1 = F.elu(self.fc1(x_pool2))
return self.fc2(x_fc1) However, when I passed my data to the model, I got an error like this below.
I thought the error comes from the batch training, but even though I tried to use
I don't know why this error happens because I think these input shapes should be the same (or similar) with the inputs in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Can you check if reshaping your x = x.view(-1, 1) |
Beta Was this translation helpful? Give feedback.
Can you check if reshaping your
x
tensor to[750, 1]
helps?