dmlc / MXNet.cpp

C++ interface for mxnet
Other
114 stars 115 forks source link

Output more informative error messsages. #72

Closed craftit closed 7 years ago

craftit commented 7 years ago

Print out exception error messages to make it easier to find out why these calls failed.

craftit commented 7 years ago

Looks like this issue has been already addressed by another pull request.

conopt commented 7 years ago

Yes, #70 is more general, which applies to all assertions.

craftit commented 7 years ago

I was thinking about this, but I wasn't sure if all assertions set error messages.

conopt commented 7 years ago

The macro family CHECK_XX will create a LogMessageFatal object, which will deconstruct eventually, and output error details as in https://github.com/dmlc/MXNet.cpp/pull/70/files#diff-d13a5bb89e95fd985ad119fb058df68aR219

craftit commented 7 years ago

But that doesn't set the value MXGetLastError() returns.

mz24cn commented 7 years ago

The InferShape error can be report by #70 , @craftit . I think InferShape is just the reason that I, and you, submitted the PRs, since InferShape failure is common and the details is very important for debug.

craftit commented 7 years ago

@mz24cn, Yes I was thinking about doing a similar change to you but I didn't think all the CHECK_XX's were related to errors set by exceptions so I went for the conservative approach. It is probably better though, as I don't think it will do any harm and should give meaningful errors in more places.