xwhan / DeepPath

code and docs for my EMNLP paper "DeepPath: A Reinforcement Learning Method for Knowledge Graph Reasoning"
533 stars 135 forks source link

Few tips about running the code #29

Open CottePutman opened 7 months ago

CottePutman commented 7 months ago

I ran this code successfully on the following enviroment within Docker Desktop: Python 2.7.3 (Notice that python version under 3.0 is necessary due to the existence of many utilization of the "print" function without brackets, which would throw errors if versions above 3.0 are implemented) Tensorflow 1.13.1 (I didnt manage to setup the gpu version)

About the dataset: You should copy the download URL of NELL-995 into your downloading software instead of visiting it directly in your broswer, while FB15k-237 can be done so.

Reason why use the docker:

  1. Tensorflow 1.13.1 for python 2.7 has no distribution for windows platform.
  2. You can pull the ready Tensorflow 1.13.1 image and run a container out of it easily.
CottePutman commented 6 months ago

I tried tensorflow-gpu 1.13.1 and the major problem was "Blas GEMM launch failed" It seems like to be caused by the insufficient GPU memory, mine of which is 16GB on RTX 3080 TI.

CottePutman commented 6 months ago

Problems in #9 as "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 6672 arrays" can be fixed in the following manner:

in evaluate.py, line 41: original code: model.fit(training_features, train_labels, nb_epoch=300, batch_size=128) modify it as: model.fit(np.array(training_features), np.array(train_labels), epochs=300, batch_size=128)

And it should be working

AutoCS-wyh commented 6 months ago

Do you understand the preprocessing steps for the NELL-995 dataset,such as tasks/${relation}/train_pos and tasks/${relation}/graph.txt.

CottePutman commented 5 months ago

Do you understand the preprocessing steps for the NELL-995 dataset,such as tasks/${relation}/train_pos and tasks/${relation}/graph.txt.

No I didn't go deeper down to the detailed algorithm, only managed to run the code and see what it can achieve