【问题标题】:How to resolve graph2vec error invalid literal for int()?如何解决 int() 的 graph2vec 错误无效文字?
【发布时间】:2020-09-06 15:56:56
【问题描述】:

我正在尝试在我创建的一些小型网络上运行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'

Research 告诉我,当预期为整数但提供了其他数据类型时会发生此错误。看起来它可能试图传递 dataset\0 作为标识符,而它应该只传递 0?

我设置了文档中指定的目录结构:

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

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

【问题讨论】:

    标签: python pandas numpy networkx


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-15
      • 1970-01-01
      • 1970-01-01
      • 2021-12-23
      • 1970-01-01
      • 1970-01-01
      • 2019-12-23
      相关资源
      最近更新 更多