如何为TextGAN-PyTorch创建自定义数据集

时间:2020-11-11 00:38:45

标签: python deep-learning nlp pytorch generative-adversarial-network

每当我使用seqGAN用自己的自定义数据集训练TextGAN-PyTorch时,我都会在每一行中写下每个句子,但是这个错误就要来了,

Starting Generator MLE Training...
Traceback (most recent call last):
  File "main.py", line 169, in <module>
    inst._run()
  File "/content/drive/My Drive/Colab Notebooks/2/TextGAN-PyTorch/instructor/real_data/seqgan_instructor.py", line 41, in _run
    self.pretrain_generator(cfg.MLE_train_epoch)
  File "/content/drive/My Drive/Colab Notebooks/2/TextGAN-PyTorch/instructor/real_data/seqgan_instructor.py", line 85, in pretrain_generator
    pre_loss = self.train_gen_epoch(self.gen, self.train_data.loader, self.mle_criterion, self.gen_opt)
  File "/content/drive/My Drive/Colab Notebooks/2/TextGAN-PyTorch/instructor/real_data/instructor.py", line 107, in train_gen_epoch
    return total_loss / len(data_loader)
ZeroDivisionError: division by zero

我正在使用Google colab来训练GAN。 如何制作自己的dataset.txt文件?

0 个答案:

没有答案