Skip to content

System.Runtime.InteropServices.SEHException : External component has thrown an exception #485

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

Closed
frank-dong-ms-zz opened this issue Jan 6, 2020 · 5 comments

Comments

@frank-dong-ms-zz
Copy link

Hi there, our team (ML.NET) is using tensorflow.NET and we are seeing below exception in some cases which is rare case and not easy to reproduce in local env:

Error Message:
System.Runtime.InteropServices.SEHException : External component has thrown an exception.
Stack Trace:
at Tensorflow.c_api.TF_SessionRun(IntPtr session, TF_Buffer* run_options, TF_Output[] inputs, IntPtr[] input_values, Int32 ninputs, TF_Output[] outputs, IntPtr[] output_values, Int32 noutputs, IntPtr[] target_opers, Int32 ntargets, IntPtr run_metadata, IntPtr status)
at Microsoft.ML.TensorFlow.TensorFlowUtils.Runner.Run() in D:\a\1\s\src\Microsoft.ML.TensorFlow\TensorflowUtils.cs:line 491
at ...

Code:
https://github.com/frank-dong-ms/machinelearning/blob/dd0faef7c6fd12b498ef9fb15ec8378650bc551b/src/Microsoft.ML.TensorFlow/TensorflowUtils.cs#L491

I'm wondering is there a way to get exception details like error message and call stack so we can investigate further?

@Oceania2018
Copy link
Member

Oceania2018 commented Jan 7, 2020

I can’t tell from the limited information. It has nothing to do with TF.NET, because you use your own runner that is calling c_api directly. Unfortunately, it will be hard to debug.

@frank-dong-ms-zz
Copy link
Author

Yes, we are using c_api directly, is there any way to catch detailed exception?

@Oceania2018
Copy link
Member

You can check the _status first.

@frank-dong-ms-zz
Copy link
Author

Thanks, let me have a try

@Nucs
Copy link
Member

Nucs commented Jan 7, 2020

Seems to be an exception thrown from C++, likely to be TF's.

  1. Checking the TF.NET's Tensorflow.Status for more details (from props: status.Message and Message.Code).
  2. System.Runtime.InteropServices.SEHException has an ErrorCode property, its value might give some insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants