質問編集履歴

1

コードの先頭のセッション情報を追記しました。

2020/03/26 08:51

投稿

ys0123
ys0123

スコア4

test CHANGED
File without changes
test CHANGED
@@ -29,6 +29,36 @@
29
29
 
30
30
 
31
31
  ### 該当のソースコード
32
+
33
+
34
+
35
+ ```python
36
+
37
+ import tensorflow as tf
38
+
39
+ import keras.backend as K
40
+
41
+ from keras.utils import multi_gpu_model
42
+
43
+ config = tf.ConfigProto()
44
+
45
+ config.gpu_options.per_process_gpu_memory_fraction = 1.0 # 割合
46
+
47
+ config.gpu_options.allow_growth = True
48
+
49
+ GPU_LIST="0"
50
+
51
+ config.gpu_options.visible_device_list=GPU_LIST
52
+
53
+ sess = tf.Session(config=config)
54
+
55
+ K.set_session(sess)
56
+
57
+ import keras
58
+
59
+ ```
60
+
61
+
32
62
 
33
63
 
34
64