williamSYSU / TextGAN-PyTorch

TextGAN is a PyTorch framework for Generative Adversarial Networks (GANs) based text generation models.
MIT License
889 stars 205 forks source link

AttributeError: 'MaliGANInstructor' object has no attribute 'train_data' #52

Open adanyaev opened 3 years ago

adanyaev commented 3 years ago

training arguments:

if_test: False run_model: maligan k_label: 2 dataset: treasure-island model_type: vanilla loss_type: rsgan mu_type: ragan eval_type: Ra d_type: Ra if_real_data: True cuda: True device: 0 devices: 0 shuffle: False gen_init: truncated_normal dis_init: uniform n_parent: 1 eval_b_num: 8 lambda_fq: 1.0 lambda_fd: 0.0 d_out_mean: True freeze_dis: False freeze_clas: False use_all_real_fake: False use_population: False samples_num: 10000 vocab_size: 7102 mle_epoch: 150 clas_pre_epoch: 10 adv_epoch: 2000 inter_epoch: 15 batch_size: 64 max_seq_len: 24 start_letter: 1 padding_idx: 0 gen_lr: 0.01 gen_adv_lr: 0.0001 dis_lr: 0.0001 clip_norm: 5.0 pre_log_step: 10 adv_log_step: 20 train_data: dataset/treasure-island.txt test_data: dataset/testdata/treasure-island_test.txt temp_adpt: exp evo_temp_step: 1 temperature: 1 ora_pretrain: True gen_pretrain: False dis_pretrain: False adv_g_step: 1 rollout_num: 16 gen_embed_dim: 32 gen_hidden_dim: 32 goal_size: 16 step_size: 4 mem_slots: 1 num_heads: 2 head_size: 256 d_step: 5 d_epoch: 3 adv_d_step: 5 adv_d_epoch: 3 dis_embed_dim: 64 dis_hidden_dim: 64 num_rep: 64 use_nll_oracle: True use_nll_gen: True use_nll_div: True use_bleu: True use_self_bleu: False use_clas_acc: True use_ppl: False log_file: log/log_0310_1756_25.txt save_root: save/20210310/treasure-island/maligan_vanilla_dt-Ra_lt-rsgan_mt-ra_et-Ra_sl24_temp1_lfd0.0_T0310_1756_25/ signal_file: run_signal.txt tips:

Traceback (most recent call last): File "D:\other\code\PyCode\courseWork\models\TextGAN-PyTorch\main.py", line 167, in inst = instruction_dictcfg.run_model File "D:\other\code\PyCode\courseWork\models\TextGAN-PyTorch\instructor\real_data\maligan_instructor.py", line 25, in init super(MaliGANInstructor, self).init(opt) File "D:\other\code\PyCode\courseWork\models\TextGAN-PyTorch\instructor\real_data\instructor.py", line 72, in init self.ppl = PPL(self.train_data, self.test_data, n_gram=5, if_use=cfg.use_ppl) AttributeError: 'MaliGANInstructor' object has no attribute 'train_data'`

When I`m trying to start training on my real dataset, this error happens Dataset files are already in correct folders

adanyaev commented 3 years ago

@williamSYSU @rakaiv5 @mnavaidd

Vaseekaran-V commented 2 years ago

Were you able to fix this issue?

I faced the same one. In the config file, I used the absolute file paths for the file references I made (example: referring to the real data file), and that did the trick for me.

sunfml commented 6 months ago

I don't fix this issue. @Vaseekaran-V @adanyaev Could you please elaborate on the solution?