简体   繁体   English

TensorFlow训练产生3个ckpt文件,哪个正确? (Music_RNN_RBM)

[英]TensorFlow, training produces 3 ckpt files, which one is correct? (Music_RNN_RBM)

I'm giving a shot at Music_RNN_RBM 我正在Music_RNN_RBM拍摄

I've trained the model and, as instruction said a ckpt file is generated, problem is that in the directory for each epoch saved I've three .ckpt .data .index and .meta example: 我已经训练了模型,并且按照说明说生成了ckpt文件,问题是在每个保存的纪元的目录中,我有三个.ckpt .data .index和.meta示例:

model.ckpt-151800.data-00000-of-00001
model.ckpt-151800.index
model.ckpt-151800.meta

Now, next step would be to generate trough 现在,下一步将是产生低谷

python rnn_rbm_generate.py <path_to_ckpt_file>

I've tried to do like this for each type of file 我尝试对每种类型的文件都这样做

python3 rnn_rbm_generate.py model.ckpt-151800.index

But I get this error each time 但是我每次都会收到这个错误

Traceback (most recent call last):
  File "rnn_rbm_generate.py", line 52, in <module>
    main(sys.argv[1])
  File "rnn_rbm_generate.py", line 43, in main
    saver.restore(sess, ckpt.model_checkpoint_path)
AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path' 

I don't get what I should do 我不知道该怎么办

As you discovered, each checkpoint consists of a .data , .meta , and a index file. 如您所发现,每个检查点都包含一个.data.meta和一个index文件。

However, TensorFlow also creates a checkpoints file, which keeps track of all the checkpoints in the output directory. 但是,TensorFlow还会创建一个checkpoints文件,该文件可跟踪输出目录中的所有检查点。 It contains a link model_checkpoint_path to the most recent checkpoint which is what your model is looking for. 它包含指向模型要查找的最新检查点的链接model_checkpoint_path

So to answer your question, the path you are providing should contain this checkpoints file. 因此,要回答您的问题,您提供的路径应包含此checkpoints文件。

There's a function to load the latest one . 有一个功能可以加载最新功能 Use it to load it, and create a proper saved model, checkpoints are used as back-up, or to continue training afterwards, not to serve. 使用它来加载它,并创建正确的保存模型,将检查点用作备份,或者在以后继续训练而不使用。 The 'checkpoints' file prouast mentioned is loaded in by the function I mentioned, it's information about the files that are being created, and can't be loaded. 我提到的功能会加载提到的“ checkpoints”文件,它是有关正在创建的文件的信息,无法加载。 Questions, ask away 问题,问走

EDIT: besides the code code in your repo indicates that you can also provide the full folder, instead of a file. 编辑:除了您的回购中的代码代码指示您还可以提供完整的文件夹,而不是文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM