davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.77k stars 4.81k forks source link

ValueError: graph_def is invalid at node 'Reshape': Input tensor 'label_batch:0' Cannot convert a tensor of type int32 to an input of type int64. #872

Open yekeng opened 6 years ago

yekeng commented 6 years ago

Traceback (most recent call last): File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\importer.py", line 667, in import_graph_def op._add_input(source_tensor, dtype=input_type) File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1898, in _add_input (tensor.dtype.name, dtype.name)) TypeError: Cannot convert a tensor of type int32 to an input of type int64

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:/python/facenet/src/validate_on_lfw.py", line 164, in main(parse_arguments(sys.argv[1:])) File "F:/python/facenet/src/validate_on_lfw.py", line 73, in main facenet.load_model(args.model, input_map=input_map) File "F:\python\facenet\src\facenet.py", line 382, in load_model saver = tf.train.import_meta_graph(os.path.join(model_exp, meta_file), input_map=input_map) File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1927, in import_meta_graph *kwargs) File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\meta_graph.py", line 741, in import_scoped_meta_graph producer_op_list=producer_op_list) File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 432, in new_func return func(args, **kwargs) File "D:\Users\yekeng\AppData\Local\Continuum\Anaconda3\lib\site-packages\tensorflow\python\framework\importer.py", line 671, in import_graph_def node, 'Input tensor %r %s' % (input_name, te))) ValueError: graph_def is invalid at node 'Reshape': Input tensor 'label_batch:0' Cannot convert a tensor of type int32 to an input of type int64.

oopenn commented 5 years ago

I also encountered this problem. How can I solve this problem?

linjingxu commented 5 years ago

I encountered this problem. File "E:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framewo rk\importer.py", line 422, in import_graph_def raise ValueError(str(e)) ValueError: Input 0 of node Reshape was passed int32 from batch_join:1 incompati ble with expected int64.

is it the problem of tensorflow's version?

QingxinWx commented 5 years ago

maybe the version of model is too old , try to download the latest version

StonePanda commented 4 years ago

i encountered the same problem too, and i change the model from 20170512-110547 to 20180402-114759, then the problem disappeared. i think maybe the model is too old, or the 2017's result vector has 128D but 2018'result has 512D.