AaronJackson / vrn

:man: Code for "Large Pose 3D Face Reconstruction from a Single Image via Direct Volumetric CNN Regression"
http://aaronsplace.co.uk/papers/jackson2017recon/
MIT License
4.51k stars 745 forks source link

Fail in main.lua : main.lua:52: '=' expected near 'continue' #157

Closed gernhard1337 closed 3 years ago

gernhard1337 commented 3 years ago

Hello! I am trying to get this to work for now 2 weeks. Today it got it as far as never, to fail again :c However, first of all, i followed this script: https://github.com/AaronJackson/vrn/issues/141 Had some errors while installing but i got everything to install and build.

Now if i type ./run.sh i get the same error as in Matlab. Matlab gives : /home/tom/usr/local/torch/install/bin/lua: main.lua:52: '=' expected near 'continue' stack traceback: [C]: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: ? Error using run (line 38) Failed to run Torch7 script.

and ./run.sh gives:

tom@tom-OMEN-by-HP-Laptop:~/usr/local/vrn$ ./run.sh /home/tom/usr/local/torch/install/bin/lua: main.lua:52: '=' expected near 'continue' stack traceback: [C]: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: ? ls: cannot access *.txt: No such file or directory ls: cannot access *.raw: No such file or directory

Does someone know how to resolve this? I am really at the end of my knowledge and wasted almost 2 weeks bugfixing.. Thanks already for your help!

AaronJackson commented 3 years ago

Looking at main.lua from the face alignment code, there is no equals sign on line 52, which suggests it has been modified. Maybe check the syntax on line 52 to make sure it's ok

gernhard1337 writes:

Hello! I am trying to get this to work for now 2 weeks. Today it got it as far as never, to fail again :c However, first of all, i followed this script: https://github.com/AaronJackson/vrn/issues/141 Had some errors while installing but i got everything to install and build.

Now if i type ./run.sh i get the same error as in Matlab. Matlab gives : /home/tom/usr/local/torch/install/bin/lua: main.lua:52: '=' expected near 'continue' stack traceback: [C]: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: ? Error using run (line 38) Failed to run Torch7 script.

and ./run.sh gives:

tom@tom-OMEN-by-HP-Laptop:~/usr/local/vrn$ ./run.sh /home/tom/usr/local/torch/install/bin/lua: main.lua:52: '=' expected near 'continue' stack traceback: [C]: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: ? ls: cannot access *.txt: No such file or directory ls: cannot access *.raw: No such file or directory

Does someone know how to resolve this? I am really at the end of my knowledge and wasted almost 2 weeks bugfixing.. Thanks already for your help!

gernhard1337 commented 3 years ago

the code is fresh cloned without any change from my side. So there cant be an error with the code or am i wrong? And on line 52 is no "=" line52 is : if(#detectedFaces<1) then goto continue end

gernhard1337 commented 3 years ago

edited the main.lua file and managed to resolve to a new error. not it is libstdc++.so.6: version GLIBCXX_3.4.18' not found (required by /home/tom/usr/local/torch/install/lib/lua/5.1/fb/python/lib.so) i will try to install this now.

but ./run.sh shows something very different:

tom@tom-OMEN-by-HP-Laptop:~/usr/local/vrn$ ./run.sh Fatal Python error: PyEval_SaveThread: NULL tstate ./run.sh: line 30: 19108 Aborted (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

AaronJackson commented 3 years ago

Which distro of Linux are you running?

That might suggest that you haven't compiled fb.pythn for a while, since the last OS upgrade at least. CentOS keeps the version of libstdc fixed, I think, between minor upgrades. I don't think Ubuntu/Fedora/etc do the same.

gernhard1337 writes:

edited the main.lua file and managed to resolve to a new error. not it is libstdc++.so.6: versionGLIBCXX_3.4.18' not found (required by /home/tom/usr/local/torch/install/lib/lua/5.1/fb/python/lib.so)` i will try to install this now.

gernhard1337 commented 3 years ago

i am running Ubuntu 14.04 like in #141 i will try that too, thanks!

gernhard1337 commented 3 years ago

i used Matlab2015a before, now i downloaded 2019a where the GLIBCXX_3.4.18 is included. Now Matlab throws the same error as ./run.sh

/bin/bash: line 1: 22358 Segmentation fault (core dumped) CUDA_VISIBLE_DEVICES=0 th main.lua -model 2D-FAN-300W.t7 -input ../examples/ -detectFaces true -mode generate -output ../examples/ -device gpu -outputFormat txt 2>&1 > /dev/null cd face-alignment;CUDA_VISIBLE_DEVICES=0 th main.lua -model 2D-FAN-300W.t7 -input ../examples/ -detectFaces true -mode generate -output ../examples/ -device gpu -outputFormat txt 2>&1 > /dev/null;: Segmentation fault Error using run (line 38) Failed to run Torch7 script.

i already recompiled fp.python. Nothing changed

AaronJackson commented 3 years ago

Ahh, yeah. matlab includes it's own libstdc++ i think.

Something definitely did change in that you now get a seg fault instead of a missing library error.

What GPU are you using? Torch7 uses CUDA 8, which isn't supported on 2080 Ti cards (and cards of that era). Below CUDA 9.5 doesn't work on these cards, so you might want to try compiling Torch7 against CUDA

  1. Maybe this would work:

https://dwijaybane.wordpress.com/2020/03/13/torch-7-with-cuda-10-on-ubuntu/

I really need to update the readme. It's quite old at this point.

gernhard1337 writes:

i used Matlab2015a before, now i downloaded 2019a where the GLIBCXX_3.4.18 is included. Now Matlab throws the same error as ./run.sh

/bin/bash: line 1: 22358 Segmentation fault (core dumped) CUDA_VISIBLE_DEVICES=0 th main.lua -model 2D-FAN-300W.t7 -input ../examples/ -detectFaces true -mode generate -output ../examples/ -device gpu -outputFormat txt 2>&1 > /dev/null cd face-alignment;CUDA_VISIBLE_DEVICES=0 th main.lua -model 2D-FAN-300W.t7 -input ../examples/ -detectFaces true -mode generate -output ../examples/ -device gpu -outputFormat txt 2>&1 > /dev/null;: Segmentation fault Error using run (line 38) Failed to run Torch7 script.

i already recompiled fp.python. Nothing changed

gernhard1337 commented 3 years ago

yes i hoped to get with #141 something more since the old readme is not up-to-date

that shoudlnt be a problem then since i got a Geforce GTX1070 (Laptop) should work then i guess?

gernhard1337 commented 3 years ago

It is now working with the guide from #141 despite i needed to use a different way in installing cuda. I am running GTX1070 which needs a newer driver than in #141. What worked for me was : install Driver bundled with the Cuda 10.1 version. After this it worked! Another Question: i am kinda new to this topic but will work myself into it. Which Program can i use to see the model? The models are shown after ./run.sh but i would like to see them in Blender or some program like this. Blender does not work. Is there a other program for this?

Thanks already and have a great new year in case u answer later.

AaronJackson commented 3 years ago

If you are still having issues, please give the https://github.com/AaronJackson/vrn-docker image a try. It's available on DockerHub but see the repo for docs.

xiaoschannel commented 2 years ago

the code is fresh cloned without any change from my side. So there cant be an error with the code or am i wrong? And on line 52 is no "=" line52 is : if(#detectedFaces<1) then goto continue end

In case anyone's wondering '=' expected near 'continue' happens because you're running goto in an old version of lua before goto was introduced, e.g. 5.1. To solve this you can rewrite the control flow to avoid goto, or use a newer version of lua.