When Op Type is not registered, log the hostname of the machine that
it is running on in the error message, since the message could be routed back during a failure on a remote binary, and it is hard to tell which machine it came from. Ideally, we'd somehow log the name of the binary running instead, but we don't have a function to get that right now. PiperOrigin-RevId: 156337679
This commit is contained in:
parent
9ca8a151b1
commit
1390dd68fe
@ -208,9 +208,8 @@ TEST_F(NodeDefBuilderTest, OpDoesNotExist) {
|
||||
.ControlInput("y")
|
||||
.Attr("foo", 12)
|
||||
.Device("device");
|
||||
ExpectFailure(
|
||||
builder,
|
||||
"Op type not registered 'Op Does Not Exist' while building NodeDef 'n'");
|
||||
ExpectFailures(builder, {"Op type not registered 'Op Does Not Exist'",
|
||||
"while building NodeDef 'n'"});
|
||||
}
|
||||
|
||||
TEST_F(NodeDefBuilderTest, Polymorphic) {
|
||||
|
@ -21,6 +21,7 @@ limitations under the License.
|
||||
#include "tensorflow/core/framework/op_kernel.h"
|
||||
#include "tensorflow/core/lib/core/errors.h"
|
||||
#include "tensorflow/core/lib/gtl/map_util.h"
|
||||
#include "tensorflow/core/platform/host_info.h"
|
||||
#include "tensorflow/core/platform/logging.h"
|
||||
#include "tensorflow/core/platform/mutex.h"
|
||||
#include "tensorflow/core/platform/protobuf.h"
|
||||
@ -83,7 +84,10 @@ Status OpRegistry::LookUp(const string& op_type_name,
|
||||
first_unregistered = false;
|
||||
}
|
||||
Status status =
|
||||
errors::NotFound("Op type not registered '", op_type_name, "'");
|
||||
errors::NotFound("Op type not registered '", op_type_name,
|
||||
"' in binary running on ", port::Hostname(), ". ",
|
||||
"Make sure the Op and Kernel are registered in the "
|
||||
"binary running in this process.");
|
||||
VLOG(1) << status.ToString();
|
||||
return status;
|
||||
}
|
||||
@ -225,7 +229,10 @@ Status OpListOpRegistry::LookUp(const string& op_type_name,
|
||||
auto iter = index_.find(op_type_name);
|
||||
if (iter == index_.end()) {
|
||||
*op_reg_data = nullptr;
|
||||
return errors::NotFound("Op type not registered '", op_type_name, "'");
|
||||
return errors::NotFound("Op type not registered '", op_type_name,
|
||||
"' in binary running on ", port::Hostname(), ". ",
|
||||
"Make sure the Op and Kernel are registered in the "
|
||||
"binary running in this process.");
|
||||
}
|
||||
*op_reg_data = iter->second;
|
||||
return Status::OK();
|
||||
|
@ -93,10 +93,11 @@ TEST(ShapeInferenceTestutilTest, Failures) {
|
||||
RunInferShapes(op, "[1];[2];[1]", "e", fn_copy_input_0));
|
||||
EXPECT_CONTAINS(RunInferShapes(op, "[1];[2];[1]", "[1];[2]", fn_copy_input_0),
|
||||
"wrong number of outputs");
|
||||
EXPECT_EQ("Op type not registered 'NoSuchOp'",
|
||||
ShapeInferenceTestutil::InferShapes(
|
||||
ShapeInferenceTestOp("NoSuchOp"), "", "")
|
||||
.error_message());
|
||||
auto error_message = ShapeInferenceTestutil::InferShapes(
|
||||
ShapeInferenceTestOp("NoSuchOp"), "", "")
|
||||
.error_message();
|
||||
EXPECT_TRUE(StringPiece(error_message)
|
||||
.starts_with("Op type not registered 'NoSuchOp'"));
|
||||
|
||||
// Wrong shape error messages.
|
||||
EXPECT_CONTAINS(RunInferShapes(op, "[1];[2];[1]", "?", fn_copy_input_0),
|
||||
|
Loading…
Reference in New Issue
Block a user