-
Notifications
You must be signed in to change notification settings - Fork 7
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
编译GEmode.cpp,然后运行乱码问题 #6
Comments
我这边输出没有乱码,你看看有没有可能是编码的问题。
… 在 2020年8月18日,下午6:44,dsj96 ***@***.***> 写道:
编译GEmode.cpp,然后运行后生成的net_time_vec.txt,net_word_vec.txt, net_reg_vec.txt, 和net_poi_vec.txt文件乱码,导致下面的topNscore.py无法运行,在GEmodel.cpp文件的OutputFile函数(line:589)做出了一些修改但不奏效,想问下楼主运行的时候乱码吗?
c++ void OutputFile(char emb_file[100], int num_vertices, ClassVertex *vertex, real *emb_vertex){ FILE *fo = fopen(emb_file, "wb");//修改为FILE *fo = fopen(emb_file, "w"); std::cout<<"outputfile... "<<num_vertices<<"\n"; // fprintf(fo, "%d %d\n", num_vertices, dim); for (int a = 0; a < num_vertices; a++) { //std::cout<<a<<"\n"; //std::cout<<vertex[a].name<<"\n"; fprintf(fo, "%s ", vertex[a].name); if (is_binary) for (int b = 0; b < dim; b++) fwrite(&emb_vertex[a * dim + b], sizeof(real), 1, fo); else for (int b = 0; b < dim; b++) fprintf(fo, "%lf ", emb_vertex[a * dim + b]); fprintf(fo, "\n"); } fclose(fo); }
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#6>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACYONAUBNRCHRZHJDLQNYTLSBJLSXANCNFSM4QDHX3RQ>.
|
嗯 好的谢谢回复,我再分析分析~ |
|
|
谢谢了,我也发现了,是二进制fwrite和fprintf的原因 |
能不能留个联系方式,编译cpp一直出现问题,搞了一周还是没搞好。 |
能不能留个联系方式,编译cpp一直出现问题,搞了一周还是没搞好。 |
编译问题多半是环境的问题,你在Linux环境下试试,按照指南安装好Boost库,应该就没问题了,我在win10上也总是编译不通过,有的c++函数在win上和Linux上书写方式不同。 |
能不能留个联系方式,编译cpp一直出现问题,搞了一周还是没搞好。 |
对,我是在MacOS上编译的,论文作者提供的源代码应该是Windows平台的,我做了些修改。 |
编译GEmode.cpp,然后运行后生成的net_time_vec.txt,net_word_vec.txt, net_reg_vec.txt, 和net_poi_vec.txt文件乱码,导致下面的topNscore.py无法运行,在GEmodel.cpp文件的OutputFile函数(line:589)做出了一些修改但不奏效,想问下楼主运行的时候乱码吗?
The text was updated successfully, but these errors were encountered: