-
Notifications
You must be signed in to change notification settings - Fork 197
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
undefined symbol: THPVariableClass #6
Comments
This often occurs when you import the extension before
Also, does this error occur when you |
Ok, I won't be able to test on the same machine before tomorrow, but the fix works on my personal laptop. Perhaps this should be mentioned in the tutorial? Maybe it's common |
It says it in the tutorial -- there is a line saying
It doesn't have anything to do with setuptools, it's just a dynamic linking issue. The |
I helped another user who made the same mistake. Maybe we can figure out a good way to give a better error message. |
@ezyang I'll think of something |
Having a similar error, and loading torch before the extension doesn't solve it. Here's the error stack:-
Error stack:-
Code base which I'm trying to run when the error occurs:- Any leads on what I should try? |
@Spandan-Madan this is basically flaking on an ABI incompatibility. (gcc > 5.1 binaries have different std::string ABI than gccc <= 5.1 binaries). For this, we (pytorch) have a patch in 0.4.1 that sets a flag to compile the cpp-extension with Did you build the extension with pytorch-master and switch back to pytorch-0.4.1 (or something of that sort)? |
Thanks for the reply @soumith. I am using an extension present in the folder I installed Pytorch using conda (both normal and your channel), but I get this error in both. Any leads on what I should try would be helpful. I've tried running with GCC 4.8 and 5.2 both, error persists. Thanks in advance :) |
@Spandan-Madan Hi, have you solved the problem yet? |
hello, i meet the same problem, and i import torch before import _C, but it also occur, could you help me? |
I suspect the underlying error is pytorch/pytorch#38122. |
Could you please check I was able to reproduce this error for two repos.
|
here is the code I am trying to run:
not sure it throws this error
|
I built an extension basing on this tutorial and it used to work. I was then doing some refactoring and fixes (in cuda/cpp code) and afterwards it started failing at runtime:
(both for CUDA and cpp versions). Then I tried if the original example still worked, and to my surprise, no longer.
Timeline:
I believe the error just means I am not linking against some static library, but I don't see when and how I could have introduced that change.
The text was updated successfully, but these errors were encountered: