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
loading trained Spektral GeneralGNN model #407
Comments
Sorry for the late reply but for some reason I stopped receiving notifications. Can you provide more details on the error you are getting? |
Hello again, For example, in one of my approach; I use the below code:
The json file consist of those informations: "{"class_name": "GeneralGNN", "config": {"output": 2, "activation": "softmax", "hidden": 256, "message_passing": 4, "pre_process": 2, "post_process": 2, "connectivity": "cat", "batch_norm": true, "dropout": 0.0, "aggregate": "sum", "hidden_activation": "prelu", "pool": "sum"}, "keras_version": "2.8.0", "backend": "tensorflow"}" The error is in the below. Same thing for
For the another approach:
Error: thank you. |
Let me look into it. In the meantime, does it work if you reinitialize a GeneralGNN model from scratch and then simply restore the weights? |
I tried loading the weights as shown in the below. I got config not found error in 3 models (model1,model2, model3). I have try them seperately, one by one.
raise ValueError(f'No model config found in the file at {filepath}.') Also I have tried another approach
File "C:\Users.....\lib\site-packages\keras\engine\training.py", line 2641, in from_config When i change the last line of code -> For the last option:When I load from json and get the weights
It wants right config files, but the files which i store does not save whole things related to GNN model (GeneralGNN). It only saves some basic or last layers. I am not sure how to do this. Training is working perfectly.Thank you. |
The problem is in recreating a model from the config, so the best you can do is instantiate a new model using the |
Thank you, now i am able to upload my trained model. Solution for other people:
note: |
Hi,
I use the GeneralGNN model from Spektral with my own dataset. Training and evaluation works fine. When I try to load the trained model, I get different errors for different loading approaches for example, weights,SavedModel, model.to_json etc..
So, my question is how to save and load the trained GeneralGNN model, is there any way to do it?. Note: I do not make any changes to this model.
thanks.
The text was updated successfully, but these errors were encountered: