소스 검색

Use soft device placement in the training session

kaiix 9 년 전
부모
커밋
a0de5ca936
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      textsum/seq2seq_attention.py

+ 2 - 1
textsum/seq2seq_attention.py

@@ -94,7 +94,8 @@ def _Train(model, data_batcher):
                              save_summaries_secs=60,
                              save_model_secs=FLAGS.checkpoint_secs,
                              global_step=model.global_step)
-    sess = sv.prepare_or_wait_for_session()
+    sess = sv.prepare_or_wait_for_session(config=tf.ConfigProto(
+        allow_soft_placement=True))
     running_avg_loss = 0
     step = 0
     while not sv.should_stop() and step < FLAGS.max_run_steps: