auroua / InsightFace_TF

Insight Face on TensorFlow
MIT License
698 stars 252 forks source link

Key resnet_v1_50 not found in checkpoint #37

Open pEko97 opened 6 years ago

pEko97 commented 6 years ago

I run the eval_ckpt_file.py and the console show with

NotFoundError (see above for traceback): Key resnet_v1_50/block1/unit_1/bottleneck_v1/PReluLayer/alpha not found in checkpoint [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]] [[Node: save/RestoreV2/_301 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_306_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

What should I do to fix the problem

pEko97 commented 6 years ago

Above problem take place when I try to use model d ckpt file as model

if I use the model trained by myself, it can work normally

# from tensorflow.python import pywrap_tensorflow
    #
    # # checkpoint_path = '/home/psy/InsightFace_TF-master/output/ckpt/InsightFace_iter_best_2000.ckpt'
    # checkpoint_path = '/home/psy/ckpt_model_d/InsightFace_iter_best_710000.ckpt'
    # reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
    # var_to_shape_map = reader.get_variable_to_shape_map()
    # for key in var_to_shape_map:
    #     print("tensor_name: ", key)
    #

if I use this block of code to find out the content of two ckpt files

[Uploading 自己训练的_self_trained.txt…]()

model d does not contain 'resnet_v1_50/block1/unit_1/bottleneck_v1/PReluLayer/alpha' key model d has less than 400 tensors

[Uploading model_d.txt…]()

the model trained by myself does contain 'resnet_v1_50/block1/unit_1/bottleneck_v1/PReluLayer/alpha' key the model has over than 600 tensors

Hoping to know how do you produce the model d file, and how can you put these ckpt file into use thanks for your time.

pEko97 commented 6 years ago

@auroua

kinraymon commented 6 years ago

@pEko97 you can see L_Resnet_E_IR_fix_issue9

YihaoWEI commented 6 years ago

Issue 9 is good to use!

pEko97 commented 6 years ago

Solved, if you meet the same problem, please re-install your tensor layer to version 1.7

pip uninstall tensorlayer
pip install tensorlayer==1.7
YihaoWEI commented 6 years ago

@pEko97 Yes, I think it is a version confict.

darchonyzx commented 5 years ago

Key resnet_v1_50/block1/unit_1/bottleneck_v1/shortcut_bn/BatchNorm/beta not found in checkpoint

tensorflow == 1.6.0 tensorlayer== 1.7.0

the issue still exists

zjz5250 commented 5 years ago

has anybody solved the problem?

zjz5250 commented 5 years ago

yes,issue9 and model D can work。@auroua thank you very much!

Dawning23 commented 5 years ago

@zjz5250 Can you tell me the version of tensorflow and tensorlayer that you successfully solved this problem?

LJXLJXLJX commented 5 years ago

Solved, if you meet the same problem, please re-install your tensor layer to version 1.7

pip uninstall tensorlayer
pip install tensorlayer==1.7

It works, thank you. tensorflow(cpu) 1.12.0 tensorlayer 1.7.0