Improve error message.
You also get this message if the variable has been deleted. PiperOrigin-RevId: 352808836 Change-Id: I928a579f177b3db839a4788c39337bf398b247de
This commit is contained in:
parent
f0ef7e229f
commit
3d2621cee7
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user