Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Tf SLIM中加载保存的检查点_Python_Tensorflow_Model_Checkpoint_Tf Slim - Fatal编程技术网

Python 如何在Tf SLIM中加载保存的检查点

Python 如何在Tf SLIM中加载保存的检查点,python,tensorflow,model,checkpoint,tf-slim,Python,Tensorflow,Model,Checkpoint,Tf Slim,我正在使用TF slim来训练我自己的数据集。根据教程,在finetune_inception_v1_on_flowers.sh中,我将检查点路径设置为./inception_resnet_v2.ckpt,并在另一个文件文件夹中获得许多新的检查点,最新的文件是model.ckpt-332331.data-00000-of-00001,model.ckpt-332331.index,model.ckpt-332331.meta 现在我想将学习速率更改为fine turing the Last ch

我正在使用TF slim来训练我自己的数据集。根据教程,在finetune_inception_v1_on_flowers.sh中,我将检查点路径设置为./inception_resnet_v2.ckpt,并在另一个文件文件夹中获得许多新的检查点,最新的文件是model.ckpt-332331.data-00000-of-00001,model.ckpt-332331.index,model.ckpt-332331.meta

现在我想将学习速率更改为fine turing the Last check point,但我不知道如何将它们加载到\u flowers.sh上的finetune_inception_v1_中,因为有3个文件而不是一个

firstly, I tried to copy the  model.ckpt-332331.data-00000-of-00001 and set the  checkpoint path as ./model.ckpt-332331.data-00000-of-00001 ,but there is the error:
NotFoundError(回溯见上文):键 在中未找到接收ResNetv2/AuxLogits/Conv2d_1b_1x1/weights/Adam 检查点[[Node:save/RestoreV2_4=RestoreV2[dtypes=[DT_FLOAT], _device=“/job:localhost/replica:0/task:0/cpu:0”](_recv_save/Const_0,save/RestoreV2_4/tensor_names,save/RestoreV2_4/shape_and_slice)]]

其次,我从日志目录中删除了文件,那么错误是:

DataLossError(回溯见上文):无法打开表文件 /media/re/7A308F7E308F405D/xsj/checkpoints/model.ckpt-332331.data-00000-of-00001: 数据丢失:不是sstable(错误的幻数):可能您的文件在 不同的文件格式,您需要使用不同的还原 操作人员[[Node:save/RestoreV2_5=RestoreV2[dtypes=[DT_FLOAT], _device=“/job:localhost/replica:0/task:0/cpu:0”](\u recv_save/Const_0,save/RestoreV2_5/tensor_name,save/RestoreV2_5/shape_and_slices)]]


有人能帮我解决这个问题吗?多谢各位

当您进行微调时,只需指定目录($CHECKPOINT_PATH)而不是任何特定文件,它将自动获取路径

如中所述

没有名为/tmp/model.ckpt的物理文件。它是前缀 为检查点创建的文件名列表。用户只与 前缀,而不是物理检查点文件

因此,您只需要将检查点路径设置为/model.ckpt-332331