-
Notifications
You must be signed in to change notification settings - Fork 184
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
System.AccessViolationException Error when using TorchSharp #1292
Comments
I could hardly provide any more details because it's just a simple pytorch trained model, and this problem also occurs in many other executions related to loading model, like below |
Yes, please start by upgrading to the most recent version of TorchSharp -- it's very hard (let's call it impossible), given limited resources, for us to troubleshoot a version as old as |
This problem still exists even when I change to version 0.102.4 when loading models....... |
Okay, that's good to know, that makes it easier to troubleshoot. Can you please show the Python code used to generate the "exported.method.dat" file? |
@NiklasGustafsson The And it could work for me. The exception is just because I didn't pass the required parameter. It's not the |
This type of exception appears to be caused by the user's system running out of memory. As the code being executed is using pointers, the OOM exception is sort of vaguely just represented as a memory access violation. I have found expanding the virtual memory can alleviate this (for users with SSD's), however, if your model is excessively large, then you may consider trialing a small version to verify it runs and then porting it to a cloud GPU. The memory issue can be verified by slowly expanding the system memory, and observing that the AccessViolation will occur in different places in code. The core issue of using too much memory could happen from a wide variety of issues. |
A System.AccessViolationException Error occurs when executing a simple code
model = jit.load(modelPath, DeviceType.CUDA);
how can I fit that
the torchsharp version is TorchSharp-cuda-windows 0.100.7
the details of error information:
System.AccessViolationException
HResult=0x80004003
Message=尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
Source=
StackTrace:
The text was updated successfully, but these errors were encountered: