读取tf的模型
2018-06-28 本文已影响0人
今天多云很多云
读取

保存的模型文件一般有:
xxx.meta:通过import_meta_graph导入meta
xxx.index
xxx.data-00-of-01:这个权重都在这。通过restore路径为xxx就能读。(注意是前缀!可以用tf.train.latest_checkpoint(checkpoint_dir)这个方法获取)
注:模型的y中有用到placeholder,在sess.run()的时候肯定要feed对应的数据,因此还要根据具体placeholder的名字,从graph中使用get_operation_by_name方法获取
写入

源码:git@github.com:hulumiaomiao/jianshu.git