title: How to train a dataset of multi-sized graph nodes and edges?
body: <p>I am working on graph neural networks. I have a dataset of images with their subjective quality scores, where images are different in size. Each image is a graph with different sizes of nodes and edges. For example:</p>
  <pre><code>img1=[nodes(1500), edges=(2300), A=(1500, 1500)], 
  img2=[nodes=(2500), edges=(5500), A=(2500, 2500)] etc.
  </code></pre>
  <p>I have prepared this dataset using <a href="https://graphneural.network/" rel="nofollow noreferrer">spektral library</a>, and I am using Keras to train this dataset like this:</p>
  <pre><code>#%%
  #N = number of nodes, F = Adjacency Matrix
  N, F = 784, 1
  X_in = Input(shape=(N, F))
  A_in = Input(shape=(N, N))
  
  #block 1
  gcn_1 = GCNConv(16, activation='relu', aggregate='sum')([X_in, A_in])
  gcn_1 = Dropout(0.5)(gcn_1)
  #block 2
  gcn_2 = GCNConv(16, activation='relu', aggregate='sum')([gcn_1, A_in])
  gcn_2 = Dropout(0.5)(gcn_2)
  #block 3
  gcn_3 = GCNConv(16, activation='relu', aggregate='sum')([gcn_2, A_in])
  gcn_3 = Dropout(0.5)(gcn_3)
  #block 4
  gcn_4 = GCNConv(16, activation='relu', aggregate='sum')([gcn_3, A_in])
  gcn_4 = Dropout(0.5)(gcn_4)
  #block 5
  gcn_5 = GCNConv(16, activation='relu', aggregate='sum')([gcn_4, A_in])
  gcn_5 = Dropout(0.5)(gcn_5)
  #block 6
  gcn_6 = GCNConv(16, activation='relu', aggregate='sum')([gcn_5, A_in])
  gcn_6 = Dropout(0.5)(gcn_6)
  ####################
  #fusion
  fusion = keras.layers.concatenate([gcn_1, gcn_2, gcn_3, gcn_4, gcn_5, gcn_6])
  ####################
  fc = Flatten()(gcn_1)
  fc = Dense(512)(fc)
  output = Dense(1)(fc)
  
  # Build model
  model = Model(inputs=[X_in, A_in], outputs=output)
  
  model.summary()
  </code></pre>
  <p>Now the problem is, every input sample has a different number of nodes, and therefore I get a cardinality error.</p>
  <p>I have also tried <a href="https://stellargraph.readthedocs.io/en/stable/demos/graph-classification/dgcnn-graph-classification.html" rel="nofollow noreferrer">StellarGraph Library</a>, but it does not work with Python==3.9.</p>
  <p>I request you please guide how can I train such a dataset with different sizes of nodes for every input sample. I shall be thankful.</p>