【问题标题】:when i am using facenet,I run ''python src/validate_on_lfw.py src/lfw_160/ src/20170512-110547/''当我使用facenet时,我运行''python src/validate_on_lfw.py src/lfw_160/src/20170512-110547/''
【发布时间】:2018-07-30 03:52:18
【问题描述】:

我尝试使用 validate_on_lfw.py 来评估具有模型“20170512-110547”的 LFW 我使用anaconda和tensorflow(我是cv的初学者,所以我不确定我给出的问题描述是否详细)

tensorflow/core/graph/graph_constructor.cc:1244] Importing a graph 
with a lower producer version 21 into an existing graph with producer 
version 26. Shape inference will have run different parts of the graph 
with different producer versions.
Traceback (most recent call last):

File "/home/wind/anaconda3/envs/tensorflow-cpu/lib/python3.6/site- 
packages/tensorflow/python/framework/importer.py", line 489, in 
import_graph_def graph._c_graph, serialized, options)  # pylint: 
disable=protected-access

tensorflow.python.framework.errors_impl.InvalidArgumentError: Input 0 
of node cross_entropy_per_example/Shape was passed int32 from 
batch_join:1 incompatible with expected int64.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "src/validate_on_lfw.py", line 164, in <module>
main(parse_arguments(sys.argv[1:]))
   File "src/validate_on_lfw.py", line 73, in main
facenet.load_model(args.model, input_map=input_map)
   File "/home/wind/facenet/src/facenet.py", line 381, in load_model
saver = tf.train.import_meta_graph(os.path.join(model_exp, meta_file), input_map=input_map)
File "/home/wind/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1955, in import_meta_graph
**kwargs)
File "/home/wind/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 743, in import_scoped_meta_graph
producer_op_list=producer_op_list)
File "/home/wind/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/home/wind/anaconda3/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 493, in import_graph_def
raise ValueError(str(e))

ValueError: Input 0 of node cross_entropy_per_example/Shape was passed 
int32 from batch_join:1 incompatible with expected int64.

【问题讨论】:

    标签: python tensorflow computer-vision


    【解决方案1】:

    将 data_flow_ops.FIFOQueue 的 dtypes 从 tf.int32 更改为 tf.int64。并且还将labels_placeholder和control_placeholder的dtypes从tf.int32更改为tf.int64。这对我有用。

    【讨论】:

      猜你喜欢
      • 2020-01-18
      • 1970-01-01
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 2014-03-25
      相关资源
      最近更新 更多