mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 04:44:08 +08:00
Fix resnet crash by setting config.gpu_options.allow_growth = True. (#971)
This commit is contained in:
committed by
Robert Nishihara
parent
9f42ef6a4f
commit
9ec3608eca
@@ -97,6 +97,7 @@ class ResNetTrainActor(object):
|
||||
self.model = resnet_model.ResNet(hps, images, labels, "train")
|
||||
self.model.build_graph()
|
||||
config = tf.ConfigProto(allow_soft_placement=True)
|
||||
config.gpu_options.allow_growth = True
|
||||
sess = tf.Session(config=config)
|
||||
self.model.variables.set_session(sess)
|
||||
self.coord = tf.train.Coordinator()
|
||||
@@ -144,6 +145,7 @@ class ResNetTestActor(object):
|
||||
self.model = resnet_model.ResNet(hps, images, labels, "eval")
|
||||
self.model.build_graph()
|
||||
config = tf.ConfigProto(allow_soft_placement=True)
|
||||
config.gpu_options.allow_growth = True
|
||||
sess = tf.Session(config=config)
|
||||
self.model.variables.set_session(sess)
|
||||
self.coord = tf.train.Coordinator()
|
||||
|
||||
Reference in New Issue
Block a user