Replies: 1 comment 1 reply
-
Oh, I see where the problem was. The MixedLoader requires different approach to training. I'm sorry for bothering! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying to fit a simple model with EdgeConv layer on dataset in Mixed mode and I get an error with the SparseTensor.
Here is my implementation:
`class StressMixedModeDataset(spektral.data.Dataset):
def init(self, data_type, **kwargs):
self.a = None
self.data_type = data_type
super().init(**kwargs)
class Net(tf.keras.models.Model):
def init(self):
super().init()
def main(args):
train = StressMixedModeDataset('train')
val = StressMixedModeDataset('val')
if name == "main":
args = parser.parse_args([] if "file" not in globals() else None)
main(args)`
The adjacency matrix is a sparse matrix and is thus converted to SparseTensor. However, from what it prints I see that somewhere it gets broken.
<class 'scipy.sparse.coo.coo_matrix'> <class 'scipy.sparse.coo.coo_matrix'> <class 'tensorflow.python.framework.sparse_tensor.SparseTensor'> Epoch 1/10 <class 'tensorflow.python.framework.ops.Tensor'>
Then I get the following error:
`File "/usr/local/lib/python3.7/dist-packages/spektral/layers/convolutional/message_passing.py", line 105, in call *
x, a, e = self.get_inputs(inputs)
File "/usr/local/lib/python3.7/dist-packages/spektral/layers/convolutional/message_passing.py", line 181, in get_inputs *
assert K.is_sparse(a), "A must be a SparseTensor"
AssertionError: A must be a SparseTensor`
Can you please help? What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions