deep-camera-relocalization
deep-camera-relocalization copied to clipboard
Could not reload the pretrained mobilenet model
NotFoundError (see above for traceback): Key MobilenetV1/Conv2d_9_pointwise/BatchNorm/beta/Adam not found in checkpoint [[Node: save_2/RestoreV2_287 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_recv_save_2/Const_0, save_2/RestoreV2_287/tensor_names, save_2/RestoreV2_287/shape_and_slices)]] [[Node: save_2/RestoreV2_110/_1209 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_1345_save_2/RestoreV2_110", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]
https://github.com/tensorflow/tensorflow/issues/312
https://github.com/tensorflow/tensorflow/issues/7244
I have solved this problem and run normally, but have you made this network loss converged as your process?
@dyz-zju Can you share some details regarding solving this issue? Having trouble to run it. Thanks!
Hi @zhuoruiyang I changed like this: try: checkpoint=tf.train.latest_checkpoint(output_file) saver.restore(sess, checkpoint) except: variables=tf.global_variables() reader=pywrap_tensorflow.NewCheckpointReader(model_path) var_keep_dic=reader.get_variables_to_shape_map() variables_to_restore = [] for v in variables: if v.name.split(':')[0] in var_keep_dic: variables_to_restore.append(v) restorer = tf.train.Saver(variables_to_restore) restorer.restore(sess, model_path)
Hi @dyz-zju
Thank you for your response!
Still, it doesn't work for me. The following is what I got. Do you have any ideas why it happens? Or maybe it's better if you don't mind to upload your working code? Perhaps there is somewhere else I need to make the changes to fix the issue.
Traceback (most recent call last):
File "/home/zhuorui/git/deep-camera-relocalization/run_posenet.py", line 197, in
@zhuoruiyang from tensorflow.python import pywrap_tensorflow
@dyz-zju I did make that change in my code so that I can run the piece of code you sent inside the original code. BTW, regarding pretrained model, I downloaded from the following link, which should be correct I believe. Any other thought? Thanks! https://github.com/tensorflow/models/tree/master/research/slim
@dyz-zju Finally, I'm able to run it properly now. Thanks for your suggestions! Your fix should work, I think I made a small mistake while setting the path.