2021
03-05
03-05
Tensorflow 读取ckpt文件中的tensor操作
在使用pre-trainmodel时候,我们需要restorevariablesfromcheckpointfiles.经常出现在checkpoint中找不到”Tensornamenotfound”.这时候需要查看一下ckpt中到底有哪些变量importosfromtensorflow.pythonimportpywrap_tensorflowcheckpoint_path=os.path.join(model_dir,"model.ckpt")#Readdatafromcheckpointfilereader=pywrap_tensorflow.NewCheckpointReader(checkpoint_path)var_to_shape_map=reader....
继续阅读 >