You are here

Segmentation fault (core dumped) error when importing pyrosetta with Tensorflow

5 posts / 0 new
Last post
Segmentation fault (core dumped) error when importing pyrosetta with Tensorflow
#1

Hi my workflow involves importing pyrosetta and tensorflow together in a single python script. And whenever I import both modules and run the program, I'm keep getting segmentation fault (core dumped) error. Here is my code:

import tensorflow as tf
from pyrosetta import *

If I put them other way around

from pyrosetta import *
import tensorflow as tf

I get Floating point exception (core dumped)

 

Here is my system information:

OS type: Fedora Linux 38 (64 bit)

Python: 3.11.4

Pyrosetta: pyrosetta-2023.45+release.a6d9ba8-cp311-cp311-linux_x86_64.whl

 

Below is the output I get from gdb debugger:

Thread 1 "python" received signal SIGFPE, Arithmetic exception.
0x00007fff7b1a4831 in std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) () from /home/ju/.cache/pypoetry/virtualenvs/hercules-An2atp8I-py3.11/lib/python3.11/site-packages/tensorflow/python/platform/_pywrap_tf2.so
(gdb) backtrace
\#0  0x00007fff7b1a4831 in std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, void*> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) () from /home/ju/.cache/pypoetry/virtualenvs/hercules-An2atp8I-py3.11/lib/python3.11/site-packages/tensorflow/python/platform/_pywrap_tf2.so
#1  0x00007fff7b1a467f in pybind11::detail::local_internals::local_internals() () from /home/ju/.cache/pypoetry/virtualenvs/hercules-An2atp8I-py3.11/lib/python3.11/site-packages/tensorflow/python/platform/_pywrap_tf2.so
#2  0x00007fff7b1a6207 in pybind11::detail::loader_life_support::get_stack_tls_key() () from /home/ju/.cache/pypoetry/virtualenvs/hercules-An2atp8I-py3.11/lib/python3.11/site-packages/tensorflow/python/platform/_pywrap_tf2.so
#3  0x00007fff7b1a237c in pybind11::cpp_function::dispatcher(_object*, _object*, _object*) () from /home/ju/.cache/pypoetry/virtualenvs/hercules-An2atp8I-py3.11/lib/python3.11/site-packages/tensorflow/python/platform/_pywrap_tf2.so
#4  0x000000000055505b in ?? ()
#5  0x000000000052f0ec in _PyObject_MakeTpCall ()
#6  0x000000000053d28e in _PyEval_EvalFrameDefault ()
#7  0x0000000000613134 in ?? ()
#8  0x0000000000612797 in PyEval_EvalCode ()
#9  0x000000000062c513 in ?? ()
#10 0x000000000054adab in ?? ()
#11 0x00000000005458d7 in _PyEval_EvalFrameDefault ()
#12 0x0000000000565f23 in _PyFunction_Vectorcall ()
#13 0x0000000000553b10 in ?? ()
#14 0x0000000000583dc1 in PyObject_CallMethodObjArgs ()
#15 0x0000000000583860 in PyImport_ImportModuleLevelObject ()
#16 0x0000000000598d96 in ?? ()
#17 0x000000000054adab in ?? ()
#18 0x00000000005458d7 in _PyEval_EvalFrameDefault ()
#19 0x0000000000565f23 in _PyFunction_Vectorcall ()
#20 0x0000000000553b10 in ?? ()
#21 0x0000000000583dc1 in PyObject_CallMethodObjArgs ()
#22 0x0000000000583860 in PyImport_ImportModuleLevelObject ()
#23 0x0000000000598d96 in ?? ()
#24 0x000000000054adab in ?? ()
#25 0x00000000005458d7 in _PyEval_EvalFrameDefault ()
#26 0x0000000000565f23 in _PyFunction_Vectorcall ()
#27 0x0000000000553b10 in ?? ()
#28 0x0000000000583dc1 in PyObject_CallMethodObjArgs ()
#29 0x0000000000583860 in PyImport_ImportModuleLevelObject ()
#30 0x00000000005428f7 in _PyEval_EvalFrameDefault ()
#31 0x0000000000613134 in ?? ()
#32 0x0000000000612797 in PyEval_EvalCode ()
#33 0x00000000006335ab in ?? ()
#34 0x000000000062f7f4 in ?? ()
#35 0x0000000000643e95 in ?? ()
#36 0x0000000000643504 in _PyRun_SimpleFileObject ()
#37 0x0000000000643317 in _PyRun_AnyFileObject ()
#38 0x000000000063dea9 in Py_RunMain ()
#39 0x0000000000603b0d in Py_BytesMain ()
#40 0x00007ffff7c29d90 in __libc_start_call_main (main=main@entry=0x603a60, argc=argc@entry=2, argv=argv@entry=0x7fffffffdde8) at ../sysdeps/nptl/libc_start_call_main.h:58
#41 0x00007ffff7c29e40 in __libc_start_main_impl (main=0x603a60, argc=2, argv=0x7fffffffdde8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffddd8) at ../csu/libc-start.c:392
#42 0x0000000000603995 in _start ()

 

 

 

Any Idea why this is happening in general with Tensorflow? Are those two modules trying to get access to the memory at the same time or something?

Category: 
Post Situation: 
Mon, 2024-06-17 08:00
proteinstudio

Thank you for letting us know! I encounter this before and only resolution would be be to ugrade version of TF being used.  For instance it TF-2.15 known to work along side PyRosetta in Google Colab environment. Hope this helps!

Tue, 2024-06-18 12:37
Sergey

Thanks for the reply.

My tensorflow is 2.16.1 and apparently downgrading to 2.15 still didn't help much :(

Is this known bug and you could reproduce the same?

Got any other suggestions if you got any?

Wed, 2024-06-19 08:59
proteinstudio

We're debugging the issue, and have some leads as to what's going on under the hood, but don't currently have any recommended fixes -- aside from changing the order in which you import pyrosetta.

---

P.S. We're updating the site, and as part of that we're moving the forums to Github Discussions.

If you have additional questions or are still having issues, please feel free to open up a thread over there.

Thu, 2024-06-20 11:24
rmoretti

Thank you, I can move the question here to the new discussions thread in Github.

changing the order of imports doesn't solve the issue.

What may be causing this issue? Could you reproduce in your own system?

Thu, 2024-06-20 15:55
proteinstudio