-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray) #162
Comments
Hi, the first entry in In this specific case, the error is because the Loader tries to create a jagged array and Numpy automatically converts that array to an I also see another problem with your code: GraphSage does not support batch mode. Cheers, |
Thank you very much! Yes, most of these problems stem from me changing from the Disjoint loader to the Batch loader. My concern with the disjoint loader is that I have networks of different sizes. Having a fixed step-size over the resultant disjoint matrix will cut off some matrices halfway, and in other cycles will combine more than one matrix (of more than one graph). Is that a valid concern? Is there something else I can do to mitigate this effect? |
It would be a valid concern if you first create a big disjoint matrix and then cut it up to create mini-batches, but that is the "magic" of the DisjointLoader. It will create a disjoint graph on the fly for each mini-batch, so there should be no problem. You only need to change this line: batch_loader = spektral.data.loaders.BatchLoader(dataset, batch_size=2) to disjoint_loader = spektral.data.loaders.DisjointLoader(dataset, batch_size=2, node_level=True) Cheers |
Thank you very much! I understand that better now. |
I'm having trouble running my Spektral model. I am aware of this issue which might have something to do with Windows paths, but I am on a Mac, and I think this is a different issue.
My code is as follows:
I get the following error:
My dataset looks like this:
Inside
batch_loader
, it looks like this:My first thought is that this error is not Spektral, but something I'm doing wrong. Is there any way to avoid it or is there a way to cast it (either
A
ory
or both) as a tensor so before fitting?The text was updated successfully, but these errors were encountered: