I extracted the test part of train.py, created a test.py, loaded the trained model in test.py, and tested the sequence.
But the values I get when I test the same data are different.
`# TEST it
from FlatAE import FlatAutoEncoder
config = tf.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
# Read the data
data, max_val, mean_pose = read_datasets_from_binary()
data_info = DataInfo(data.train.sigma, data.train._sequences.shape,
data.test._sequences.shape, max_val)
# Pad max values and the mean pose, if needed
if FLAGS.amount_of_frames_as_input > 1:
max_val = np.tile(max_val, FLAGS.amount_of_frames_as_input)
mean_pose = np.tile(mean_pose, FLAGS.amount_of_frames_as_input)
ae_shape = [FLAGS.frame_size * FLAGS.amount_of_frames_as_input] + ae_hidden_shapes + [
FLAGS.frame_size * FLAGS.amount_of_frames_as_input]
# create model
ae = FlatAutoEncoder(ae_shape, sess, batch_size, variance, data_info)
sess.run(tf.local_variables_initializer())
with tf.variable_scope("test"):
sess.run(tf.global_variables_initializer())
saver = tf.train.Saver(write_version=saver_pb2.SaverDef.V2)
chkpt_file = FLAGS.chkpt_dir + '/chkpt-' + str(FLAGS.chkpt_num)
saver.restore(sess, chkpt_file)
print("Model restored from the file " + str(chkpt_file) + '.')
# print("---------TESTING------------")
rmse = test(ae, FLAGS.data_dir + '/../test_seq/basketball.binary', max_val, mean_pose, False)
print("\nbasketball: ", rmse)
rmse = test(ae, FLAGS.data_dir + '/../test_seq/basketball.binary', max_val, mean_pose, False)
print("\nbasketball: ", rmse))`
This is the code for test,missing markers are fixed,I got two different rmse.The same model, the same input and the same missing marks, I feel the same rmse value should appear,but no.
Is it that I call the model to make the test wrong or something else?I hope I can get help solving this problem.