Closed SeekPoint closed 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
, , _, self.gen_o, self.gen_x = control_flow_ops.While(
, , _, self.gen_o, self.gen_x = tf.while_loop( cond=lambda i, _1, _2, _3, _4: i < self.sequence_length, body=_g_recurrence, loop_vars=(tf.constant(0, dtype=tf.int32), @@ -84,7 +84,7 @@ class LSTM(object): x_tp1 = ta_emb_x.read(i) return i + 1, x_tp1, h_t, g_predictions
, , _, self.g_predictions = control_flow_ops.While(
, , _, self.g_predictions = tf.while_loop( cond=lambda i, _1, _2, _3: i < self.sequence_length, body=_pretrain_recurrence, loop_vars=(tf.constant(0, dtype=tf.int32),
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$