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

Error in executing link_prediction_eval.sh #9

Closed
bagindokemas opened this issue Oct 19, 2018 · 1 comment
Closed

Error in executing link_prediction_eval.sh #9

bagindokemas opened this issue Oct 19, 2018 · 1 comment

Comments

@bagindokemas
Copy link

Hi Wenhan,

I found this error when running this command ./link_prediction_eval.sh concept_athletehomestadium (I run it in a CPU server that has Python 2.7, Keras, and Tensorflow).

Using TensorFlow backend.
11
How many paths used: 11
evaluate.py:42: UserWarning: The nb_epoch argument in fit has been renamed epochs.
model.fit(training_features, train_labels, nb_epoch=300, batch_size=128)
Traceback (most recent call last):
File "evaluate.py", line 260, in
evaluate_logic()
File "evaluate.py", line 108, in evaluate_logic
model = train(kb, kb_inv, named_paths)
File "evaluate.py", line 42, in train
model.fit(training_features, train_labels, nb_epoch=300, batch_size=128)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 952, in fit
batch_size=batch_size)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 751, in _standardize_user_data
exception_prefix='input')
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training_utils.py", line 102, in standardize_input_data
str(len(data)) + ' arrays: ' + str(data)[:200] + '...')
ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 4867 arrays: [array([[0],
[0],
[0],
[0],
[0],
[0],
[0],
[1],
[1],
[1],
[1]]), array([[0],
[0],
[0],
[0],
[0],
...
Is this was caused by the Keras Library? The transR_eval.py, transE_eval.py, transX_eval.py worked fine.
Could you advise me how to solve this?

Thank you very much.

@bagindokemas
Copy link
Author

After trying and googling, I found out the way to solve this issue.
Just put np.array before the training_features and train_labels parameter. After that, the link prediction code work.

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

1 participant