bug fix: index number or context

dev
Steve L. Nyemba 5 years ago
parent f9496ed806
commit af6ab356d8

@ -424,7 +424,7 @@ class Train (GNet):
dataset = tf.data.Dataset.from_tensor_slices(features_placeholder) dataset = tf.data.Dataset.from_tensor_slices(features_placeholder)
# labels_placeholder = None # labels_placeholder = None
dataset = dataset.repeat(10000) dataset = dataset.repeat(10000)
print ([' ******* ',self.BATCHSIZE_PER_GPU])
dataset = dataset.batch(batch_size=self.BATCHSIZE_PER_GPU) dataset = dataset.batch(batch_size=self.BATCHSIZE_PER_GPU)
dataset = dataset.prefetch(1) dataset = dataset.prefetch(1)
# iterator = dataset.make_initializable_iterator() # iterator = dataset.make_initializable_iterator()

@ -244,8 +244,19 @@ if __name__ == '__main__' :
f = open (filename) f = open (filename)
PIPELINE = json.loads(f.read()) PIPELINE = json.loads(f.read())
f.close() f.close()
index = int(SYS_ARGS['index']) if 'index' in SYS_ARGS else 0 index = SYS_ARGS['index']
if index.isnumeric() :
index = int(SYS_ARGS['index'])
else:
#
# The index provided is a key to a pipeline entry mainly the context
#
N = len(PIPELINE)
f = [i for i in range(0,N) if PIPELINE[i]['context'] == index]
index = f[0] if f else 0
#
# print
print ("..::: ",PIPELINE[index]['context'])
args = (PIPELINE[index]) args = (PIPELINE[index])
args = dict(args,**SYS_ARGS) args = dict(args,**SYS_ARGS)

Loading…
Cancel
Save