Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 关于“的错误”;全球“步骤”;使用NVIDIA DeepLearningExamples Resnet50v1.5 SavedModel生成的估计器进行预测时_Python_Tensorflow - Fatal编程技术网

Python 关于“的错误”;全球“步骤”;使用NVIDIA DeepLearningExamples Resnet50v1.5 SavedModel生成的估计器进行预测时

Python 关于“的错误”;全球“步骤”;使用NVIDIA DeepLearningExamples Resnet50v1.5 SavedModel生成的估计器进行预测时,python,tensorflow,Python,Tensorflow,我的工作流程如下: 我在中修改了export_freezed_graph.py以导出Resnet50v1.5模型的SavedModel以进行推理测试 然后,我将保存的模型加载到估计器中,如下所示: estimator=tf.contrib.estimator.savedModelSimator(保存的模型位置) 然后我尝试预测并打印预测结果,如下所示: predictions=estimator.predict(lambda:get\u dataset()) 对于预测中的pred: 打

我的工作流程如下:

  • 我在中修改了export_freezed_graph.py以导出Resnet50v1.5模型的SavedModel以进行推理测试
  • 然后,我将保存的模型加载到估计器中,如下所示:
estimator=tf.contrib.estimator.savedModelSimator(保存的模型位置)
  • 然后我尝试预测并打印预测结果,如下所示:
predictions=estimator.predict(lambda:get\u dataset())
对于预测中的pred:
打印('pred:{}'。格式(pred))
但是,我得到了一个关于
global\u step
的错误,如下所示:

Traceback (most recent call last):
  File "estimator_inference.py", line 73, in <module>
    main()
  File "estimator_inference.py", line 70, in main
    benchmark_inference()
  File "estimator_inference.py", line 64, in benchmark_inference
    for pred in predictions:
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", l
    features, None, ModeKeys.PREDICT, self.config)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", l
    model_fn_results = self._model_fn(features=features, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/canned/saved_mod
    training_util.assert_global_step(global_step_tensor)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/training_util.py", line 176
    global_step_tensor)
TypeError: Existing "global_step" must be a Variable or Tensor: None.
回溯(最近一次呼叫最后一次):
文件“estimator_inference.py”,第73行,在
main()
文件“estimator_inference.py”,第70行,主目录
基准_推断()
文件“estimator_推断.py”,第64行,在基准_推断中
对于预测中的pred:
文件“/usr/local/lib/python3.6/dist-packages/tensorflow_-estimator/python/estimator/estimator.py”,l
功能,无,ModeKeys.PREDICT,self.config)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow_-estimator/python/estimator/estimator.py”,l
模型\结果=自身。\模型\结果(特征=特征,**kwargs)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow\u estimator/python/estimator/canted/saved\u mod
训练工具断言全局步骤(全局步骤张量)
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/training/training_util.py”,第176行
全局(步进张量)
TypeError:现有的“全局步骤”必须是变量或张量:无。
有人对如何解决这个问题有什么建议吗