Skip to content

Commit

Permalink
Merge pull request thmoa#6 from rcrvano/master
Browse files Browse the repository at this point in the history
set tf.config allow_growth
  • Loading branch information
thmoa authored Apr 29, 2019
2 parents 2b23cab + 27ef61e commit 4bab53b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions infer_batch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import csv
import argparse
import tensorflow as tf
import keras.backend as K

from glob import glob

Expand All @@ -9,6 +11,8 @@


def main(weights, num, batch_file, opt_pose_steps, opt_shape_steps):
K.set_session(tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True))))

model = Octopus(num=num)

with open(batch_file, 'rb') as f:
Expand Down
4 changes: 4 additions & 0 deletions infer_single.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os
import argparse
import tensorflow as tf
import keras.backend as K

from glob import glob

Expand All @@ -14,6 +16,8 @@ def main(weights, name, segm_dir, pose_dir, out_dir, opt_pose_steps, opt_shape_s
if len(segm_files) != len(pose_files) or len(segm_files) == len(pose_files) == 0:
exit('Inconsistent input.')

K.set_session(tf.Session(config=tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True))))

model = Octopus(num=len(segm_files))
model.load(weights)

Expand Down

0 comments on commit 4bab53b

Please sign in to comment.