2017-09-21 18 views
0

テンソルフローを最新バージョンに更新した後、私のチェックポイントがディスクから読み込まれません。Tensorflowが更新後にチェックポイントからRNNをロードできない

... 
File "/usr/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1560, in restore 
    {self.saver_def.filename_tensor_name: save_path}) 
    File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 895, in run 
    run_metadata_ptr) 
    File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1124, in _run 
    feed_dict_tensor, options, run_metadata) 
    File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1321, in _do_run 
    options, run_metadata) 
    File "/usr/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1340, in _do_call 
    raise type(e)(node_def, op, message) 
tensorflow.python.framework.errors_impl.NotFoundError: Key model/rnn/multi_rnn_cell/cell_0/lstm_cell/kernel not found in checkpoint 
    [[Node: model/save/RestoreV2_4 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_model/save/Const_0_0, model/save/RestoreV2_4/tensor_names, model/save/RestoreV2_4/shape_and_slices)]] 

答えて

0

変数名が変更され、チェックポイントで名前を変更する必要があります。上の例では、weights -> kernel

ありがたいことに、誰かが一緒に入れてa script which should automatically rename your variablesです。これは初めての変数ではなく、チェックポイントからの読み込みが壊れています。

usage: checkpoint_convert.py [-h] [--write_v1_checkpoint] 
          checkpoint_from_path checkpoint_to_path 

positional arguments: 
    checkpoint_from_path Path to source checkpoint to be read in. 
    checkpoint_to_path Path to checkpoint to be written out. 

optional arguments: 
    -h, --help   show this help message and exit 
    --write_v1_checkpoint 
         Write v1 checkpoint 
関連する問題