LantaoYu / SeqGAN

Implementation of Sequence Generative Adversarial Nets with Policy Gradient
2.09k stars 710 forks source link

AttributeError: 'module' object has no attribute 'While' #4

Closed SeekPoint closed 7 years ago

SeekPoint commented 7 years ago

rzai@rzai00:~/prj/SeqGAN/MLE_SeqGAN$ CUDA_VISIBLE_DEVICES=0 python pretrain_experiment.py I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally Traceback (most recent call last): File "pretrain_experiment.py", line 123, in main() File "pretrain_experiment.py", line 85, in main generator = get_trainable_model(vocab_size) File "pretrain_experiment.py", line 36, in get_trainable_model return PoemGen(num_emb, BATCH_SIZE, EMB_DIM, HIDDEN_DIM, SEQ_LENGTH, START_TOKEN) File "/home/rzai/prj/SeqGAN/MLESeqGAN/model.py", line 62, in init , , , self.gen_o, self.gen_x = control_flow_ops.While( AttributeError: 'module' object has no attribute 'While' rzai@rzai00:~/prj/SeqGAN/MLE_SeqGAN$

SeekPoint commented 7 years ago

it can be fix by

--- a/MLE_SeqGAN/model.py +++ b/MLE_SeqGAN/model.py @@ -59,7 +59,7 @@ class LSTM(object): gen_x = gen_x.write(i, next_token) # indices, batch_size return i + 1, x_tp1, h_t, gen_o, gen_x