Skip to content
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

How to use predict func after training model ? #32

Open
monkey1302 opened this issue Oct 20, 2021 · 2 comments
Open

How to use predict func after training model ? #32

monkey1302 opened this issue Oct 20, 2021 · 2 comments

Comments

@monkey1302
Copy link

After training step, I got a 'model' object . And then how to use it to predict new data?

I tried model.predict([X, A],verbose=0) and got some error
InvalidArgumentError: Incompatible shapes: [32,32] vs. [32,9928] [[node model/graph_attention/add_15 (defined at <ipython-input-10-0d3199260314>:122) ]] [Op:__inference_predict_function_131650]

@danielegrattarola
Copy link
Owner

Hi,

like when using model.fit, you have to specify the batch_size to be equal to the number of nodes.

Btw, this repo is quite old and I suggest you look at the more up-to-date examples on the Spektral library:

https://github.com/danielegrattarola/spektral/blob/master/examples/node_prediction/citation_gat.py

Cheers

@XuRuiAngel
Copy link

Can model. predict() be used to process multiple graphs at once, receiving X with the shape of (batch_size, N, F) and A with the shape of (batch_size, N, N)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants