-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance execution error info #18482
Enhance execution error info #18482
Conversation
test=develop
test=develop
262c3d7
to
eb7fd1d
Compare
python/paddle/fluid/executor.py
Outdated
if isinstance(e, core.EOFException): | ||
raise e | ||
print("An exception was thrown!\n {}".format(str(e))) | ||
sys.exit(-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some user use try ... except
to catch the EOFException
, but exe.run
may throw other Exception
.
try:
loss_data, = exe.run(compiled_prog,
fetch_list=[loss.name])
print(loss_data)
except Exception as e:
print("EOF ")
void InitGLOG(const std::string &prog_name) { | ||
// glog will not hold the ARGV[0] inside. | ||
// Use strdup to alloc a new string. | ||
google::InitGoogleLogging(strdup(prog_name.c_str())); | ||
#ifndef _WIN32 | ||
google::InstallFailureSignalHandler(); | ||
google::InstallFailureWriter(&SignalHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use InstallFailureWriter
to catch the dump info.
test=develop
25c6d75
to
c48da62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
try ... except
to catch theEOFException
, butexe.run
may throw otherException
.