diff --git a/tensorflow/core/kernels/resource_variable_ops.cc b/tensorflow/core/kernels/resource_variable_ops.cc index d16c8f51450..950a80b6b2d 100644 --- a/tensorflow/core/kernels/resource_variable_ops.cc +++ b/tensorflow/core/kernels/resource_variable_ops.cc @@ -136,11 +136,10 @@ void ReadVariableOp::Compute(OpKernelContext* ctx) { const auto status = LookupResource(ctx, handle, &variable); OP_REQUIRES(ctx, status.ok(), errors::FailedPrecondition( - "Could not find variable ", handle.name(), ". ", - "This could mean that the variable has been deleted. ", - "In TF1, it can also mean the variable is uninitialized. ", - "Debug info: container=", handle.container(), - ", status=", status.ToString())); + "Error while reading resource variable ", handle.name(), + " from Container: ", handle.container(), + ". This could mean that the variable was uninitialized. ", + status.ToString())); tf_shared_lock ml(*variable->mu()); // We're acquiring a reference to the underlying buffer while diff --git a/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py b/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py index 48441423e88..b9d9f007167 100644 --- a/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py +++ b/tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py @@ -193,7 +193,7 @@ class CSRSparseMatrixOpsTest(test.TestCase): a_rt = sparse_csr_matrix_ops.csr_sparse_matrix_to_dense( v, type=dtypes.float32) v_reassign = state_ops.assign(v, v_id).op - with self.assertRaisesOpError("uninitialized"): + with self.assertRaisesOpError("Error while reading resource variable sm"): self.evaluate(a_rt) self.evaluate(v.initializer) a_rt_value = self.evaluate(a_rt)