CR-Gjx / LeakGAN

The codes of paper "Long Text Generation via Adversarial Training with Leaked Information" on AAAI 2018. Text generation using GAN and Hierarchical Reinforcement Learning.
https://arxiv.org/abs/1709.08624
577 stars 181 forks source link

Modulo by Zero error when attempting to train on custom dataset #32

Open Dormin92 opened 5 years ago

Dormin92 commented 5 years ago

I've been trying to get your LeakGAN to work for some time now but I just don't understand what format your realtrain_cotra file is or what kind of preencoding you've done to it. I have a text dataset, but replacing realtrain_Cotra doesn't work. I thought it needed to be onehot encoded, but that didn't work. I thought maybe it just needed to be label encoded but that doesn't work. I converted the label encoded integer array into a simple string to try and closely match the kind of data you have in your realtrain_cotra but then it gives me a divide by zero error.

epoch: 0
Traceback (most recent call last): File "Main.py", line 285, in main() File "Main.py", line 177, in main gen_data_loader.create_batches(positive_file) File "/content/LeakGAN/Image COCO/dataloader.py", line 22, in create_batches self.sequence_batch = np.split(np.array(self.token_stream), self.num_batch, 0) File "/usr/local/lib/python2.7/dist-packages/numpy/lib/shape_base.py", line 847, in split if N % sections: ZeroDivisionError: integer division or modulo by zero

what in the world do you do to get this system working on custom data?