Skip to content

Commit

Permalink
model trainer limit memory init
Browse files Browse the repository at this point in the history
  • Loading branch information
haifeng-jin committed Apr 19, 2018
1 parent c99295e commit a969a6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions autokeras/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def train_model(self):
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
init = tf.global_variables_initializer()
sess.run(init)
backend.set_session(sess)
try:
if constant.DATA_AUGMENTATION:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def test_model_trainer():
np.random.rand(1, 3), False).train_model()


@patch('autokeras.utils.backend')
def test_model_trainer_not_augmented(_):
def test_model_trainer_not_augmented():
constant.DATA_AUGMENTATION = False
constant.LIMIT_MEMORY = True
model = RandomConvClassifierGenerator(3, (28, 28, 1)).generate()
Expand Down

0 comments on commit a969a6e

Please sign in to comment.