question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure to read model in Tensorflow r1.0

See original GitHub issue

Hey I’m getting this error in Tensorflow 1.0 after modifying the code to get working

NotFoundError (see above for traceback): Tensor name "rnnlm/multi_rnn_cell/cell_0/gru_cell/candidate/biases" not found in checkpoint files models/reddit/model.ckpt-4682964
	 [[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_slices)]]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Aug 31, 2017

@pender

Yeah it looks like the variable names changed with Tensorflow 1.0 (this repo was created under v0.11). I haven’t looked into this in depth yet but I expect the right dictionary used in connection with a saver will make it possible to fix this without retraining the model from scratch.

I tried this and it works. Thank you. But can you please confirm if what i have done is correct?

I used the below list

names_list=[
        "rnnlm/softmax_w",
        "rnnlm/softmax_b",
        "rnnlm/embedding",
 "rnnlm/MultiRNNCell/Cell0/GRUCell/Gates/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell0/GRUCell/Gates/Linear/Bias",
  "rnnlm/MultiRNNCell/Cell0/GRUCell/Candidate/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell0/GRUCell/Candidate/Linear/Bias",
"rnnlm/MultiRNNCell/Cell1/GRUCell/Gates/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell1/GRUCell/Gates/Linear/Bias",
  "rnnlm/MultiRNNCell/Cell1/GRUCell/Candidate/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell1/GRUCell/Candidate/Linear/Bias",
 "rnnlm/MultiRNNCell/Cell2/GRUCell/Gates/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell2/GRUCell/Gates/Linear/Bias",
  "rnnlm/MultiRNNCell/Cell2/GRUCell/Candidate/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell2/GRUCell/Candidate/Linear/Bias",
 "rnnlm/MultiRNNCell/Cell3/GRUCell/Gates/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell3/GRUCell/Gates/Linear/Bias",
  "rnnlm/MultiRNNCell/Cell3/GRUCell/Candidate/Linear/Matrix",
 "rnnlm/MultiRNNCell/Cell3/GRUCell/Candidate/Linear/Bias",
 
]

Then in sample_main(args) function I assigned this list to variable tensors to form a dict to be passed to tf.train.Saver.

saver = tf.train.Saver(builtins.dict(zip(names_list,tf.trainable_variables())))

Placed the whole code here https://github.com/NarahariKaushik/toy_chatbot . Not sure how to contribute to this repo(still new to git hub)

1reaction
FaisalAbidcommented, Mar 2, 2017

Did you modify your code to make it work on TensorFlow 1.0?

On Thu, Mar 2, 2017, 3:00 AM aguang1201 notifications@github.com wrote:

I got the same problem.I retrained the model with tensorflow1.0.It worked.That`s all.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pender/chatbot-rnn/issues/6#issuecomment-283583094, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPfBKGXbZPvNGzbDdYmYUvQexgDB1idks5rhncHgaJpZM4MMpA2 .

Sent from my phone

Read more comments on GitHub >

github_iconTop Results From Across the Web

tensorflow lite cannot use my own model, crashed without ...
but when i use my own model converted by toco, it crashed without any information. set input and load model seemed correct, but...
Read more >
TensorFlow not found using pip - Stack Overflow
My problem turned out to be that Tensorflow at this time does not yet support Python 3.7 (it supports up to 3.6.x). After...
Read more >
Solved: Re: bitbake tensorflow-lite is failed! - NXP Community
The compilation error of tensorflow-lite is caused by your bad network environment. I handled this problem when I compiled L5.4.3_1.0.0. You can also...
Read more >
Installation | TensorFlow Hub
Installing tensorflow_hub. The tensorflow_hub library can be installed alongside TensorFlow 1 and TensorFlow 2. We recommend that new users ...
Read more >
Installation - TensorFlow 2 Object Detection API tutorial
If you attempt to install both TensorFlow CPU and TensorFlow GPU, without making use of virtual environments, you will either end up failing,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found