mks0601 / TF-SimpleHumanPose

TensorFlow implementation of "Simple Baselines for Human Pose Estimation and Tracking", ECCV 2018
336 stars 90 forks source link

sess run with dynamic batch size #17

Closed jackytu256 closed 5 years ago

jackytu256 commented 5 years ago

Hi mks, I gotta run inference while loading the ckpt file as well as the input node name I choose is "tower_0/Placeholder" based on the tester.predict function you wrote. the ideal shape should be (None,256,192,3), but I don't know why the shape I get is (32,256,192,3). The code is following.

saver = tf.train.import_meta_graph('location of meta file',clear_devices=True)
sess = tf.Session() 
saver.restore(sess, 'location of ckpt file') 
_input = sess.graph.get_tensor_by_name("tower_0/Placeholder:0")
print(_input)
<tf.Tensor 'tower_0/Placeholder:0' shape=(32, 256, 192, 3) dtype=float32>

Any idea to change the batch size to None? Thanks

mks0601 commented 5 years ago

I think 376-402 lines of lib/tfflat/base.py is related with this issue. Maybe this code changes the graph which is saved in training stage to testing mode graph.

jackytu256 commented 5 years ago

Thanks mks