-
Notifications
You must be signed in to change notification settings - Fork 201
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
Segmentation Fault when importing SimpleITK 2.0 before TensorFlow #1208
Comments
Thank you for reporting this issue. We will look into it. |
SimpleITK wheels are compiled per PEP 513 manylinux1, while tensor flow is manylinux2010. I believe these should be interoperable; I will need further investigation. |
Here is an related piece with PyArrow: https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html Specifically the section "Annoying end users issue #2: 'Segmentation fault after import TensorFlow"' appear to be relevant. |
This fix is inspired but the following article and linked changes: https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html Use a linker script make only the one global symbol needed by Python visible, while the others remain local. This hides the weak C++/std symbol which can conflict with other libraries. Specifically, the std::call_once conflicting with tensorflow. Addresses SimpleITK#1208 and SimpleITK#1192.
I had the same issue. |
This fix is inspired but the following article and link changes: https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html Use a version linker script make only the one global symbol needed by Python visible, while the others remain local. This hides the weak C++/std symbol which can conflict with versions. Specifically, the std::call_once conflicting with tensorflow. Addresses SimpleITK#1208 and SimpleITK#1192.
This fix is inspired but the following article and link changes: https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html Use a version linker script make only the one global symbol needed by Python visible, while the others remain local. This hides the weak C++/std symbol which can conflict with versions. Specifically, the std::call_once conflicting with tensorflow. Addresses SimpleITK#1208 and SimpleITK#1192.
This fix is inspired but the following article and link changes: https://uwekorn.com/2019/09/15/how-we-build-apache-arrows-manylinux-wheels.html Use a version linker script make only the one global symbol needed by Python visible, while the others remain local. This hides the weak C++/std symbol which can conflict with versions. Specifically, the std::call_once conflicting with tensorflow. Addresses SimpleITK#1208 and SimpleITK#1192.
I can confirm that using this wheel ( |
SimpleITK 2.0.1 have been uploaded to pypi, which addresses the import order issue with tensor flow. |
Likely related to #1192
OS: Ubuntu 20.04
Python 3.8.2 (tested with 3.7, too)
Make a virtualenv:
test.py
:If we reverse the order of imports (TensorFlow first), it works fine. I'm not sure whether it's an issue with TF or SimpleITK, but it doesn't happen with SimpleITK==1.2.4.
The text was updated successfully, but these errors were encountered: