rxn4chemistry / rxnmapper

RXNMapper: Unsupervised attention-guided atom-mapping. Code complementing our Science Advances publication on "Extraction of organic chemistry grammar from unsupervised learning of chemical reactions" (https://advances.sciencemag.org/content/7/15/eabe4166).
http://rxnmapper.ai
MIT License
286 stars 68 forks source link

segmentation fault #19

Closed sergeismolnikov closed 3 years ago

sergeismolnikov commented 3 years ago

Would you kindly help us solve the following issue:

We have a large number of reactions (~20000) that we need to map, however, when we run a script that goes through list of reactions and maps it one by one it is always finished with "####(some number like 4929) segmentation fault".

We tried to find correlations between smirks and error frequencies, but did not succeed so that we came up with conclusion that these errors occur randomly. We also tried to map reactions which broke the mapper distinctly, without cycle, and they were mapped succesfuly.

rxn_mapper = RXNMapper()
mapped_reaction = rxn_mapper.get_attention_guided_atom_maps([rea])

PyCharm in debug mode showed the following error message: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).

MacOS 10.15.7 Python 3.7

pschwllr commented 3 years ago

You wouldn't have a minimal example for us to reproduce this segmentation fault?

If the error is really random, then one workaround for you could be to continuously save the atom-mapped reactions, rerun the script after the segmentation fault on the remaining reactions until you have the atom-mapping for all of them.

sergeismolnikov commented 3 years ago

Thank you for your advice, but it seems to be that catching C++ segfaults is impossible in python interpreter.

However, we managed to run mapping in Linux environment on our cluster and it helped, but atom-mapping speed reduced by several times, presumably, because of lack of GPU acceleration.

pschwllr commented 3 years ago

Yes, without GPU the atom-mapping speed is reduced by a factor of ~7. The best would probably be a Linux environment with an Nvidia GPU.