Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel not found in checkpoint #20

Open
kriskrishnaa opened this issue Mar 3, 2018 · 5 comments
Open

kernel not found in checkpoint #20

kriskrishnaa opened this issue Mar 3, 2018 · 5 comments

Comments

@kriskrishnaa
Copy link

Using TensorFlow backend.
(158915, 4096)
(158915,)
Two young guys with shaggy hair look at their hands while hanging out in the yard .
preprocessing 30 word vocab
preprocessed words 20326 -> 2942
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1327, in _do_call
return fn(*args)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1306, in _run_fn
status, run_metadata)
File "C:\Program Files\Python36\lib\contextlib.py", line 88, in exit
next(self.gen)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Key RNN/basic_lstm_cell/kernel not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/SONY/Desktop/img_cap/training.py", line 206, in
train(.001,True,True) #continue training from pretrained weights @epoch500
File "C:/Users/SONY/Desktop/img_cap/training.py", line 176, in train
saver.restore(sess,tf.train.latest_checkpoint(model_path_transfer))
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1560, in restore
{self.saver_def.filename_tensor_name: save_path})
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
run_metadata_ptr)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1321, in _do_run
options, run_metadata)
File "C:\Program Files\Python36\lib\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 RNN/basic_lstm_cell/kernel not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

Caused by op 'save/RestoreV2_1', defined at:
File "", line 1, in
File "C:\Program Files\Python36\lib\idlelib\run.py", line 144, in main
ret = method(*args, **kwargs)
File "C:\Program Files\Python36\lib\idlelib\run.py", line 474, in runcode
exec(code, self.locals)
File "C:/Users/SONY/Desktop/img_cap/training.py", line 206, in
train(.001,True,True) #continue training from pretrained weights @epoch500
File "C:/Users/SONY/Desktop/img_cap/training.py", line 165, in train
saver = tf.train.Saver(max_to_keep=100)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1140, in init
self.build()
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1172, in build
filename=self._filename)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 688, in build
restore_sequentially, reshape)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 407, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 247, in restore_op
[spec.tensor.dtype])[0])
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 663, in restore_v2
dtypes=dtypes, name=name)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Key RNN/basic_lstm_cell/kernel not found in checkpoint
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

# please resolve this!

@chandanmishra-03
Copy link

I am facing same problem.can anyone help?

@mohitbindal10
Copy link

it seems the model was trained on previous version of tf having a bit different layer architectures. i am training my own model and will ask for pull once it is trained upto good accuracy. And btw if u train your own model keep batch sizes to minimum. The model tends to diverge on larger batch sizes

@chandanmishra-03
Copy link

Hey I used docker method.Its easy.try it ,you will not get error.

@wangzhanxd
Copy link

do you solve it?

@kriskrishnaa
Copy link
Author

kriskrishnaa commented Oct 31, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants