1adrianb / 2D-and-3D-face-alignment

This repository implements a demo of the networks described in "How far are we from solving the 2D & 3D Face Alignment problem? (and a dataset of 230,000 3D facial landmarks)" paper.
https://www.adrianbulat.com/face-alignment
Other
944 stars 210 forks source link

"Segmentation fault (core dumped)" #5

Closed jgoenetxea closed 7 years ago

jgoenetxea commented 7 years ago

I have followed all the steps mentioned in the readme file, but when I run the script:

th main.lua

The console says: 'Segmentation fault (core dumped)'

I have the models and the dataset included in the same folder, and trying to follow the paths described in the 'opts.lua' file.

Is there any thing more I have to do to put the program working?

1adrianb commented 7 years ago

@jgoenetxea I just made some changes a hour ago. Could you please check it now? Thank you.

jgoenetxea commented 7 years ago

I have downloaded all the changes (git pull) and I have reinstalled all elements again to be sure they are correctly installed. However, it looks like there are some 'random' errors. Y tried to run the 'main.lua' file four times with four different responses. I have never used Lua before, so I do not know what could be happening.

Here how the terminal look:

(p2k) jgoenetxea@Trantor:~/git/2D-and-3D-face-alignment$ th main.lua 
Segmentation fault (core dumped)
(p2k) jgoenetxea@Trantor:~/git/2D-and-3D-face-alignment$ th main.lua 
Fatal Python error: PyEval_SaveThread: NULL tstate
Aborted (core dumped)
(p2k) jgoenetxea@Trantor:~/git/2D-and-3D-face-alignment$ th main.lua 
Fatal Python error: ceval: tstate mix-up
Fatal Python error: GC object already tracked
Aborted (core dumped)
(p2k) jgoenetxea@Trantor:~/git/2D-and-3D-face-alignment$ th main.lua 
Fatal Python error: PyEval_SaveThread: NULL tstate
Aborted (core dumped)
(p2k) jgoenetxea@Trantor:~/git/2D-and-3D-face-alignment$ 

Any suggestion?

jgoenetxea commented 7 years ago

I have updated the text in the previous comment, but I don't know it the system notifies the edits.

1adrianb commented 7 years ago

It looks like it doesn't like the python/numpy/matplotlib versions, I remember it working with the version that is present in the ubuntu repository, but not with the ones updated via pip. Could you please run it by disabling the plotting part of the code (which uses python) or install the numpy&matplotlib versions available in the ubuntu repository ? If this doesnt help please let me know and I will have a second look (and probably release a Docker image)

jgoenetxea commented 7 years ago

Ok, I have commented all the 'py.exec' blocks, and it looks that the segmentation fault is fixed.

However, it asks for new dependencies not listed in the readme file: cunn, matio and npy4th

I have included them with:

luarocks install cunn
luarocks install matio
luarocks install npy4th

After those installation, is not able to find the data

Scanning directory for data...  
Found 0 **images**

, but there is not any segmentation fault.

1adrianb commented 7 years ago

I will add cunn to the list, I missed it somehow. The matio and npy4th should be optional and they are used if the input data is in .mat or .npy/npz format

1adrianb commented 7 years ago

I will also prepare a Docker image over the weekend to avoid this kind of issues in the future

happyfrank commented 7 years ago

I got the same issue.I commended the 'py.exec' blocks. there is not any segmentation fault. But I got this error:

Scanning directory for data...  
Found 5 images  
5 images require a face detector    
Initialising python libs... 
Initialising detector...    
/home/ubuntu/usr/local/torch/install/bin/luajit: ./facedetection_dlib.lua:22: Python error: execute Python code
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'np' is not defined

stack traceback:
    [C]: in function 'reval'
    ./facedetection_dlib.lua:22: in function 'detect'
    main.lua:51: in main chunk
    [C]: in function 'dofile'
    ...ocal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: at 0x00405d50
1adrianb commented 7 years ago

Hi @happyfrank, In the meantime python dlib is used for face detection and further python code removals are required. You can sanitize this and remove also this part. Alternatively you can use the Docker image provided, which should set up the environment for you. There is also another version of this code in python which should be hopefully easier to setup.

kzw5309 commented 6 years ago

I tried to run AaronJackson/vrn that contains your 2D-and-3D-face-alignment, but I got the following error after following the solution above. Scanning directory for data... Found 5 imag Scanning directory for data...
Found 5 images
5 images require a face detector
Initialising python libs... Initialising detector...
/home/ron/usr/local/torch/install/bin/luajit: main.lua:51: Python code must be string stack traceback: [C]: in function 'detect' main.lua:51: in main chunk [C]: in function 'dofile' ...ocal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00405d50 es 5 images require a face detector Initialising python libs... Initialising detector... /home/ron/usr/local/torch/install/bin/luajit: main.lua:51: Python code must be string stack traceback: [C]: in function 'detect' main.lua:51: in main chunk [C]: in function 'dofile' ...ocal/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00405d50 Do you have any ideas how to solve this problem?

1adrianb commented 6 years ago

Hi @kzw5309 the above solution is indeed for people that don't need the face detection, while you actually needed. You have to makr sure all the python stack is properly installed. Please check the docker image for an example.

kzw5309 commented 6 years ago

If I uncomment python code, I will get the following error.

./run.sh: line 30: 16055 Segmentation fault (core dumped) th main.lua -model 2D-FAN-300W.t7 -input ../$INPUT/ -detectFaces true -mode generate -output ../$INPUT/ -device gpu -outputFormat txt ls: cannot access '.txt': No such file or directory ls: cannot access '.raw': No such file or directory

I have installed all dependencies you mentioned, but I don't have any experience with docker. Could you share me with more details what I should do with docker image example?

crazySyaoran commented 6 years ago

Hi @kzw5309 I also come from AaronJackson/vrn and got same problem with you. Did you solve it finally?

leeeeeeo commented 6 years ago

@happyfrank @1adrianb Hello, I met the same problem. Any suggestions please? image