chenyilun95 / tf-cpn

Cascaded Pyramid Network for Multi-Person Pose Estimation (CVPR 2018)
MIT License
793 stars 197 forks source link

About saving model during training #18

Closed FightForCS closed 6 years ago

FightForCS commented 6 years ago

The original code save model after every one ecpoh. What if I want to save model only when validation loss is smaller? How can I add evaluation code during training? Thanks.

chenyilun95 commented 6 years ago

This question concerns the tensorflow implementation of training strategy . One simple method is to compute the validation loss after each epoch. Note that it should not compute gradient back (i.e. remove train_op from sess.run). You need to modify the file lib/tfflat/base.py to change training schedule. Note that you should feed validation data. But I think the implementation can be complex and you might need to re-design the code structure.