Example #1
0
    sess.run(tf.global_variables_initializer())
else:
    saver.restore(sess, load_path)
    print("Model restored from %s." % load_path)

if outputPressure:
    outputDataName = "pressure"

# load test data
tiCr.loadTestDataNpz(fromSim,
                     toSim,
                     emptyTileValue,
                     cropTileSizeLow,
                     cropOverlap,
                     0.95,
                     0.05,
                     load_vel=useVelocities,
                     low_res_size=simSizeLow,
                     upres=upRes,
                     keepAll=keepAll,
                     special_output_type=outputDataName,
                     bWidth=bWidth)

if useVelocities and not useDensity:
    tiCr.reduceInputsToVelocity(dimensions=3)
    tiCr.splitTileData(0.95, 0.05)

# create a summary to monitor cost tensor
lossTrain = tf.summary.scalar("loss", costFunc)
lossTest = tf.summary.scalar("lossTest", costFunc)
merged_summary_op = tf.summary.merge_all()
Example #2
0
# create session and saver
sess = tf.InteractiveSession()
saver = tf.train.Saver()

# init vars or load model
if loadModelTest == -1:
	sess.run(tf.global_variables_initializer())
else:
	saver.restore(sess, load_path)
	print("Model restored from %s." % load_path)


# load test data
if (fileFormat == "npz"):
	tiCr.loadTestDataNpz(fromSim, toSim, emptyTileValue, cropTileSizeLow, cropOverlap, 0.95, 0.05, load_vel=useVelocities, low_res_size=simSizeLow, upres=upRes, keepAll=keepAll)
elif (fileFormat == "uni"):
	tiCr.loadTestDataUni(fromSim, toSim, emptyTileValue, cropTileSizeLow, cropOverlap, 0.95, 0.05, load_vel=useVelocities, low_res_size=simSizeLow, upres=upRes)
else:
	print("\n ERROR: Unknown file format \"" + fileFormat + "\". Use \"npz\" or \"uni\".")
	exit()

#uniio.backupFile(__file__, test_path)

# create a summary to monitor cost tensor
lossTrain  = tf.summary.scalar("loss",     costFunc)
lossTest   = tf.summary.scalar("lossTest", costFunc)
merged_summary_op = tf.summary.merge_all() 
summary_writer    = tf.summary.FileWriter(test_path, sess.graph)

# ---------------------------------------------