-
Notifications
You must be signed in to change notification settings - Fork 45
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
Bias not found in checkpoint #7
Comments
@abhisuri97 |
Here is the output I get on that command:
The regular
Am I missing a file or something here? |
@abhisuri97, I had tried to run this model on the latest version of TF (1.2.0), but encountered the same error: OLD_CHECKPOINT_FILE = "model.ckpt-1000000"
NEW_CHECKPOINT_FILE = "model2.ckpt-1000000"
import tensorflow as tf
vars_to_rename = {
"lstm/basic_lstm_cell/weights": "lstm/basic_lstm_cell/kernel",
"lstm/basic_lstm_cell/biases": "lstm/basic_lstm_cell/bias",
}
new_checkpoint_vars = {}
reader = tf.train.NewCheckpointReader(OLD_CHECKPOINT_FILE)
for old_name in reader.get_variable_to_shape_map():
if old_name in vars_to_rename:
new_name = vars_to_rename[old_name]
else:
new_name = old_name
new_checkpoint_vars[new_name] = tf.Variable(reader.get_tensor(old_name))
init = tf.global_variables_initializer()
saver = tf.train.Saver(new_checkpoint_vars)
with tf.Session() as sess:
sess.run(init)
saver.save(sess, NEW_CHECKPOINT_FILE) |
@mimol that worked. thank you so much!!!! |
@mimol |
@mimol your code finally solve my problem.thank you very much~~ |
thanks. please add to readme... |
@0xDFDFDF What if we can't go back to Tensorflow1.1? Or how can I go to that version having the below error: UnsatisfiableError: The following specifications were found to be in conflict:
I can't downgrade my cudnn and cudatoolkit due to systemwide settings. |
@0xDFDFDF where did you apply these changes? Can you please give more starter points? I am using CharLSTM and got this error charlesashby/CharLSTM#9 |
To anyone wondering, I've just executed @0xDFDFDF 's script (#7 (comment)) using the tensorflow v1.10.0 and it worked fine. |
@abhisuri97 could you tell me what @mimol said? I just can't see any answer from him |
@ndwuhuangwei that was my old login, so you are perhaps looking for this answer: #7 (comment) |
So finally how did you solve your problems? I am toubled with this problem either very much. I need your help and I can't see what mimol said.@abhisuri97 |
@maoao686868 As @DominikFilipiak mentioned earlier, the code is here: #7 (comment) Of course, I haven't looked at this codebase for a while so I am not sure if that is still a valid solution or not. |
@abhisuri97 ,thanks for your reply,but my question is "biases not found in checkpoint" not "kernel not found in checkpoint". I am expecting your answer |
@maoao686868 It seems like this line |
Please @DominikFilipiak , I'm using a pretrained model to my new model , but the same error( about bias does not exist in checkpoints) appears to me. |
Please all, I'm using a pretrained model to my new model , but the same error( about bias does not exist in checkpoints) appears to me. |
I’m having some problems running the Pretrained-Show-and-Tell-model
I am using tensorflow v1.2 and python 2.7 (in addition to checking out the latest versions of your repo and the im2txt model repo).
I am getting the following error:
My Full Trace is Below:
The text was updated successfully, but these errors were encountered: