Tensorflow | FailedPreconditionError错误

错误日志:

tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found.
  (0) Failed precondition: Error while reading resource variable crf_1/left_boundary from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/crf_1/left_boundary)
	 [[{{node crf_1/ExpandDims/ReadVariableOp}}]]
	 [[crf_1/while_1/Exit_2/_49]]
  (1) Failed precondition: Error while reading resource variable crf_1/left_boundary from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/crf_1/left_boundary)
	 [[{{node crf_1/ExpandDims/ReadVariableOp}}]]

1、问题原因:
Tensorflow中,所有变量都必须初始化才能使用。

2、操作被拒绝,因为系统不处于执行状态.

在初始化变量之前运行读取 tf.Variable 的操作时,通常会引发此异常.

3、循环嵌套了session

你可能感兴趣的:(python,深度学习,tensorflow)