def test(sess, data, max_steps, display_fetches, output_dir = a.output_dir):
    #testing at most, process the test data once
    sess.run(data.iterator.initializer)
    max_steps = min(data.stepsPerEpoch, max_steps)
    filesets = []
    for step in range(max_steps):
        try:
            results = sess.run(display_fetches)
            filesets.extend(helpers.save_images(results, output_dir, a.batch_size, a.nbTargets))

        except tf.errors.OutOfRangeError:
            print("testing fails in OutOfRangeError")
            continue
    index_path = helpers.append_index(filesets, output_dir, a.nbTargets, a.mode)
    return filesets
Beispiel #2
0
def test(sess, data, max_steps, display_fetches, output_dir = a.output_dir):
    #Runs the minimum steps between what is asked by user(max_steps) and how many steps are in the full dataset (stepsPerEpoch)
    sess.run(data.iterator.initializer)
    max_steps = min(data.stepsPerEpoch, max_steps)
    filesets = []
    for step in range(max_steps):
        try:
            #Get the results
            results = sess.run(display_fetches)
            
            #save the output images and add them to the list of outputed items
            filesets.extend(helpers.save_images(results, output_dir, a.batch_size, a.nbTargets))
        except tf.errors.OutOfRangeError:
            print("testing fails in OutOfRangeError")
            continue
    #Create an HTML file to vizualize test results.            
    index_path = helpers.append_index(filesets, output_dir, a.nbTargets, a.mode)
    return filesets