CharlesShang / TFFRCNN

FastER RCNN built on tensorflow
MIT License
874 stars 418 forks source link

How to transform our trained model for test? #86

Open liuwei16 opened 7 years ago

liuwei16 commented 7 years ago

The error is 'Unable to open table file ./data/pretrain_model/VGGnet_fast_rcnn_iter_70000.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?'

liangzz1991 commented 7 years ago

you may generated four files.(checkpoint,data,meta,index). so if you want run demo.py,you should modify some code of demo.py: saver = tf.train.Saver() saver.restore(sess, args.model) to saver =tf.train.Saver(write_version =saver_pb2.SaverDef.V1) ckpt =tf.train.get_checkpoint_state(args.model) print("ckpt:", ckpt) if ckpt and ckpt.model_checkpoint_path: saver.restore(sess,ckpt.model_checkpoint_path) print (' done.')

forget add "from tensorflow.core.protobuf import saver_pb2" in the beginning

ruyiwei-cas commented 7 years ago

@zhaoliang210325 Can you say more detail?

ruyiwei-cas commented 7 years ago

@zhaoliang210325 what is args.model? how can i modify it?

liangzz1991 commented 7 years ago

def parse_args(): """Parse input arguments.""" parser = argparse.ArgumentParser(description='Faster R-CNN demo') parser.add_argument('--gpu', dest='gpu_id', help='GPU device id to use [0]', default=0, type=int) parser.add_argument('--cpu', dest='cpu_mode', help='Use CPU mode (overrides --gpu)', action='store_true') parser.add_argument('--net', dest='demo_net', help='Network to use [vgg16]', default='VGGnet_test') parser.add_argument('--model', dest='model', help='Model path', default='/home/deep/tffaster/output/fs_models/voc_2007_trainval/')

args = parser.parse_args()

return args

you only need to give the 'checkpoint'(checkpoint,data,meta,index) path to the args.model, it will read #### the last model via checkpoint.

gentlebreeze1 commented 6 years ago

hello?do you run successful faster rcnn with pvanet?please help me.Thanks @ruyiweicas