Forums

502 Error- uWSGI process 1 got Segmentation Fault !!!

Hello I'm trying to get some help with the error here! I have some keras (using tf backend) and scikit learn models in my app and this is the first time I've tried to deploy anything like this!.The error logs contain no more errors and for the life of me I cant figure out whats going on with this one! (works perfectly on local machine)

Thanks for your time

2018-10-16 17:44:39 Using TensorFlow backend.
2018-10-16 17:44:39 * Model loaded!
2018-10-16 17:44:39 unable to load configuration from from multiprocessing.semaphore_tracker import main;main(12)
2018-10-16 17:44:39 /home/drdesai/.virtualenvs/flask-app-env/lib/python3.6/site-packages/sklearn/base.py:251: UserWarning: Trying to unpickle estimator LinearRegression from version 0.19.1 when using version 0.20.0. This might lead to breaking code or invalid results. Use at your own risk.#012  UserWarning)
2018-10-16 17:44:39 !!! uWSGI process 1 got Segmentation Fault !!!

2018-10-16 17:44:39 *** backtrace of 1 ***#012/usr/local/bin/uwsgi(uwsgi_backtrace+0x2c) [0x46529c]#012/usr/local/bin/uwsgi(uwsgi_segfault+0x21) [0x465661]#012/lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7f8829c58cb0]#012/home/drdesai/.virtualenvs/flask-app-env/lib/python3.6/site-packages/sklearn/neighbors/kd_tree.cpython-36m-x86_64-linux-gnu.so(+0x404b6)

[0x7f87cac304b6]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x105) [0x7f88289bc005]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x16b5fa) [0x7f8828a555fa]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x2f3c) [0x7f8828a58cfc]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x16a890) [0x7f8828a54890]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x16b7b4) [0x7f8828a557b4]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x2f3c) [0x7f8828a58cfc]#012/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x16a890) [0x7f8828a54890]#012/usr/lib/x86_
2018-10-16 17:44:39 chdir(): No such file or directory [core/uwsgi.c line 1610]
2018-10-16 17:44:39 VACUUM: unix socket /var/sockets/drdesai.pythonanywhere.com/socket removed.

[edit by admin: formatting]

Tensorflow does some strange stuff with threads, which makes it crash in environments where threading is disabled (like websites on PythonAnywhere). However, as you're using Keras, it should work fine if you switch to the Theano backend.