wbenbihi / hourglasstensorflow

Tensorflow implementation of Stacked Hourglass Networks for Human Pose Estimation
MIT License
479 stars 177 forks source link

Segmentation fault when runnning inference with pre trained weights #53

Closed LucasMahieu closed 2 years ago

LucasMahieu commented 5 years ago

I am trying to run the inference.py script with the pre trained weights.

here is my main :

if __name__ == '__main__':
    infer = Inference(config_file = 'HG/config.cfg', model = 'HG/hg_refined_200', yoloModel = 'HG/YOLO_small.ckpt')
    infer.webcamSingle()

But I am facing a segfault :

CREATE MODEL:
---Inputs : Done (0 sec.)
---Graph : Done (5 sec.)
---Loss : Done (0 sec.)
WARNING:tensorflow:From /work1/lmahieu/hourglasstensorlfow/hourglass_tiny.py:625: arg_max (from tensorflow.python.ops.gen_math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `argmax` instead
---Acc : Done (1 sec.)
---LR : Done (0 sec.)
---Optim : Done (0 sec.)
---Minimizer : Done (8 sec.)
---Init : Done (0 sec.)
Model created (15 sec.)
('Graph Generated in ', 15, ' sec.')
Session initialization
Sess initialized in 0 sec.
Loading Trained Model
('Model Loaded (', 0.7259650230407715, ' sec.)')
('YOLO created: ', 0.5169098377227783, ' sec.')
Loading YOLO...
Restoring weights from: HG/YOLO_small.ckpt
('Trained YOLO Loaded: ', 1.0975430011749268, ' sec.')
Prediction Tensors Ready!
('Done: ', 19.734932899475098, ' sec.')
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
Fatal Python error: Segmentation fault

Current thread 0x00007f7b464fe740 <python> (most recent call first):
  File "./hourglasstensorlfow/predictClass.py", line 658 in hpeWebcam
  File "inference.py", line 60 in webcamSingle
  File "inference.py", line 223 in <module>
[1]    8196 segmentation fault  python inference.py

Does someone have any idea ?

When attaching a GDB, I have

(gdb) bt
#0  0x00007ffff7ad2aa5 in do_warn () at /lib64/libpython2.7.so.1.0
#1  0x00007ffff7ad323d in PyErr_WarnEx () at /lib64/libpython2.7.so.1.0
#2  0x00007fffb15900f7 in _log_func () at /usr/lib64/python2.7/site-packages/gobject/_gobject.so
#3  0x00007fffb98e17a1 in g_logv () at /lib64/libglib-2.0.so.0
#4  0x00007fffb98e1a4f in g_log () at /lib64/libglib-2.0.so.0
#5  0x00007fffbb5b0396 in gtk_disable_setlocale () at /lib64/libgtk-x11-2.0.so.0
#6  0x00007fffbdf77876 in cvInitSystem () at /lib64/libopencv_highgui.so.2.4
#7  0x00007fffbdf77d52 in cvNamedWindow () at /lib64/libopencv_highgui.so.2.4
#8  0x00007fffbdf784cd in cvShowImage () at /lib64/libopencv_highgui.so.2.4
#9  0x00007fffbdf7474a in cv::imshow(std::string const&, cv::_InputArray const&) () at /lib64/libopencv_highgui.so.2.4
#10 0x00007fffbf1fa791 in pyopencv_imshow(_object*, _object*, _object*) () at /usr/lib64/python2.7/site-packages/cv2.so
#11 0x00007ffff7af3cf0 in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#12 0x00007ffff7af603d in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#13 0x00007ffff7af353c in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#14 0x00007ffff7af603d in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#15 0x00007ffff7af353c in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#16 0x00007ffff7af603d in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#17 0x00007ffff7af6142 in PyEval_EvalCode () at /lib64/libpython2.7.so.1.0
#18 0x00007ffff7b0f57f in run_mod () at /lib64/libpython2.7.so.1.0
#19 0x00007ffff7b1073e in PyRun_FileExFlags () at /lib64/libpython2.7.so.1.0
#20 0x00007ffff7b119c9 in PyRun_SimpleFileExFlags () at /lib64/libpython2.7.so.1.0
#21 0x00007ffff7b22b7f in Py_Main () at /lib64/libpython2.7.so.1.0
#22 0x00007ffff6d49b15 in __libc_start_main () at /lib64/libc.so.6
#23 0x000000000040066e in _start ()