free(): invalid pointer when importing tensorflow (python 2.7, spacy-nightly)
How to reproduce the behavior
run script
import spacy
import tensorflow
with python 2.7.12
stacktrace is the following:
*** Error in /usr/bin/python2.7': free(): invalid pointer: 0x00007f2d96c91ac0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f2dac7477e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f2dac75037a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f2dac75453c]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8overflowEi+0x181)[0x7f2d9e745fa1]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt15basic_streambufIcSt11char_traitsIcEE6xsputnEPKcl+0x89)[0x7f2d9e79ce79]
/usr/local/lib/python2.7/dist-packages/torch/lib/libshm.so(_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l+0x1c5)[0x7f2d96a06235]
/usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow6errors18FailedPreconditionIIPKcEEENS_6StatusEDpT_+0x214)[0x7f2d6cd9fac4]
....
Issue is not reproducible using last release version of spacy (2.0.18) or using python 3.5.2
Also, if tensorflow is imported before spacy, issue can not be reproduced either.
import tensorflow
import spacy
works fine.
Your Environment
- Operating System: Ubuntu 16.04
- Python Version Used: 2.7.12
- spaCy Version Used: 2.1.0a5
- Environment Information:
tensorflow version 1.8
Thanks for the report. This was pretty disturbing, but I haven't been able to reproduce it with spacy-nightly==2.1.0a8. I tried on Python2.7 with Tensorflow 1.8. Could you check whether it still occurs? I'm not sure what could be wrong.
One thing I notice is /usr/local/lib/python2.7/dist-packages/torch in your traceback. Could this be some interaction with PyTorch...? I didn't install that, and spaCy has never depended on it. But if you have PyTorch installed, we do have a wrapper for PyTorch models inside our machine learning library Thinc. Perhaps there's some GPU conflict?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.