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

Errors when testing the train.py with tensorflow as backend #26

Closed
zhangyu2ustc opened this issue Feb 13, 2018 · 9 comments
Closed

Errors when testing the train.py with tensorflow as backend #26

zhangyu2ustc opened this issue Feb 13, 2018 · 9 comments

Comments

@zhangyu2ustc
Copy link

Hi,
I was trying to test the keras-gcn package with the cora dataset.
But there is always an error when I try to run the command: H = GraphConvolution(16, support, activation='relu', kernel_regularizer=l2(5e-4))([H]+G)

Output message:
Loading cora dataset...
Dataset has 2708 nodes, 5429 edges, 1433 features.

InvalidArgumentError: Dimensions must be equal, but are 4299 and 1433 for 'graph_convolution_2/MatMul' (op: 'MatMul') with input shapes: [?,4299], [1433,16].

The dataset has a shape of (2708, 1433) for input and (2708, 7) for output.

Do you have a clue what causes this error and how can I fix it ?
My keras version is 2.1.1, with tensorflow (version 1.4.0) as backend.

Thanks!
Best,
Yu.

@zhangyu2ustc zhangyu2ustc changed the title Errors when testing the training.py with tensorflow as backend Errors when testing the train.py with tensorflow as backend Feb 13, 2018
@tkipf
Copy link
Owner

tkipf commented Feb 14, 2018

Interesting- thanks for reporting. Did you make any changes to the code?

@zhangyu2ustc
Copy link
Author

Thanks for the quick reply.

No, I did not make changes to the script, but the codes into jupyter-notebook for running.
Is that a problem?

@tkipf
Copy link
Owner

tkipf commented Feb 14, 2018

Can you try running the script directly from the command line?

@zhangyu2ustc
Copy link
Author

Sorry, I have errors during installation of the package:
error: [Errno 5] Input/output error: '${HOME}/tensorflow/lib/python3.5/site-packages/kegra-0.0.1-py3.5.egg

This is probably due to the permission issues in our local clusters. That's why I want to test it using jupyter.
Do you have any idea what might cause the problem of changing the dimensionality: [?,4299]

@tkipf
Copy link
Owner

tkipf commented Feb 14, 2018

I'm not sure how I can reproduce your error. But instead of installing the package you can also add the folder containing it to your PYTHONPATH environment variable, e.g. by running

export PYTHONPATH="~/code/keras-gcn/:$PYTHONPATH"

Simply replace ~/code/keras-gcn/ with the path where your package is located.

After the folder is added to your PYTHONPATH environment variable, you can run the model from your command line (without installing the package).

@zhangyu2ustc
Copy link
Author

Thanks! It worked in this way!

@tkipf tkipf closed this as completed Feb 14, 2018
@zhangyu2ustc
Copy link
Author

The error message showed up again when I change the FILTER method from 'localpool' to 'chebyshev' even by running "python train.py" from terminal

ValueError: Dimensions must be equal, but are 4299 and 1433 for 'graph_convolution_1/MatMul' (op: 'MatMul') with input shapes: [?,4299], [1433,16].

@tkipf tkipf reopened this Feb 14, 2018
@tkipf
Copy link
Owner

tkipf commented Feb 14, 2018

Ah, thanks for catching this - this is something I can look into.

@tkipf
Copy link
Owner

tkipf commented Feb 26, 2018

Fixed with eb89564

@tkipf tkipf closed this as completed Feb 26, 2018
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

2 participants