如何为int()解析graph2vec错误的无效文本



我正在尝试在我创建的一些小型网络上运行graph2vec。它可以通过特征提取阶段,但当它开始优化时,会抛出一个错误:

Traceback (most recent call last):
File "src/graph2vec.py", line 129, in <module> main(args)
File "src/graph2vec.py", line 125, in main save_embedding(args.output_path, model, graphs, args.dimensions)
File "src/graph2vec.py", line 98, in save_embedding out.append([int(identifier)] + list(model.docvecs["g_"+identifier]))
ValueError: invalid literal for int() with base 10: 'dataset\0'

研究告诉我,当期望一个整数但提供了一些其他数据类型时,就会发生这种错误。看起来它可能正在尝试为标识符传递数据集\0,而它应该只传递0?

我按照文档中的规定设置了目录结构:

graph2vec
dataset
[contains many json data files]
features
src
graph2vec.py
param_parser.py

我正在顶部的graph2vec目录中运行python src/graph2vec.py。知道出了什么问题吗?

问题似乎是上面链接的普通graph2vec库假设安装了Linux,并且有一个适用于Windows的karateclub实现。问题是它被反斜杠卡住了。

最新更新