【问题标题】:GPT-2's encoder.py and train.py are not workingGPT-2 的 encoder.py 和 train.py 不工作
【发布时间】:2021-07-03 13:52:24
【问题描述】:

我正在尝试训练 GPT-2 使用我在文本文件 napoleon.txt 中提供的内容。当我运行编码器时,它似乎可以在命令提示符下工作。

python encoder.py napoleon.txt napoleon.npz

然而,它实际上并没有创建 napoleon.npz。但这只是问题的一部分。更大的问题是 train.py,我训练 GPT-2 真正需要的,每次都会吐出一个错误。

Traceback (most recent call last):
  File "train.py", line 19, in <module>
    from .dataset import Corpus, EncodedDataset
ImportError: attempted relative import with no known parent package

我已经尝试了我在互联网上找到的所有我能想到的解决方案,但我被困住了。请帮忙

【问题讨论】:

    标签: python artificial-intelligence gpt-2


    【解决方案1】:

    查看文档: https://github.com/openai/gpt-2-output-dataset/tree/master/detector

    您应该以python -m detector.train 的身份运行它。

    【讨论】:

      猜你喜欢
      • 2021-10-27
      • 2017-11-11
      • 1970-01-01
      • 2020-10-03
      • 2022-12-07
      • 1970-01-01
      • 2020-05-18
      • 2020-01-06
      • 2016-08-19
      相关资源
      最近更新 更多