thunlp / TensorFlow-TransX

An implementation of TransE and its extended models for Knowledge Representation Learning on TensorFlow
MIT License
514 stars 196 forks source link

transR.cpp:427:59: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #1

Closed dengyang17 closed 7 years ago

dengyang17 commented 7 years ago

When I was using the transX.cpp, I got this warning. How could I fix this.

THUCSTHanxu13 commented 7 years ago

The warning will not affect the results. If you want to fix the warning, you can change "426:for (int a = 0; a < transRThreads; a++)" to "for (long a = 0; a < transRThreads; a++)". I will fix the codes as soon as possible.

dengyang17 commented 7 years ago

Thanks. Although the warning has been fixed, after runing the code, nothing came out, neither error nor result.

THUCSTHanxu13 commented 7 years ago

string inPath = "./data/"; and string outPath = "./out/"; define the input and output path. If there is not a folder called "out" in the current directory, the results can not be written into the output files. You need "mkdir out" or change outPath to "" before you run the code.

dengyang17 commented 7 years ago

I mean after the whole epoch [train_transe(NULL);] , it doesn't save the model [out_transe();]. And I have set the path.

hfsugar commented 7 years ago

Where is the output file? I didn't find " string outPath = "./out/" " in your code. How to get the vectors of entities and relations. Thank you!

THUCSTHanxu13 commented 7 years ago

To use the TensorFlow-TransX, "saver.save(sess, 'model.vec')" will output the vectors to the file "model.vec" without any other operations. To use the C version Fast-TransX, the default output files will be "./out/relation2vec.vec" and "./out/entity2vec.vec". If there is not a folder called "out", "fopen" can not create "./out/relation2vec.vec" and "./out/entity2vec.vec". Note that, "fopen" in C can only create files. Changing outPath in TransR.cpp to "./" will let you get the vectors.