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.52k stars 742 forks source link

Error loading module 'fb.python.lib' #28

Closed DeqiangXiao closed 6 years ago

DeqiangXiao commented 6 years ago

Hi Aaron, Thanks for sharing your work! The outcome of 3D face reconstruction with your method (online model testing) is really good. To test your code in further, I downloaded your github code and tried to configure its environment on a linux server of our lab (Ubuntu 14.04.5 LTS, kernel 3.16.0-77-generic; Python 2.7.14; Torch7). Finally, I successfully configured all dependences according to the guidance on VRN github webpage (https://github.com/AaronJackson/vrn) , but an lib linking error occurs when run "run.sh" as follows:

deqiang@andrew:~/Toolkits/VRN/vrn$ ./run.sh /home/deqiang/Toolkits/Torch/install/bin/luajit: ...iang/Toolkits/Torch/install/share/lua/5.1/trepl/init.lua:389: ...iang/Toolkits/Torch/install/share/lua/5.1/trepl/init.lua:389: ...iang/Toolkits/Torch/install/share/lua/5.1/trepl/init.lua:389: ...Toolkits/Torch/install/share/lua/5.1/luarocks/loader.lua:117: error loading module 'fb.python.lib' from file '/home/deqiang/Toolkits/Torch/install/lib/lua/5.1/fb/python/lib.so': /home/deqiang/Toolkits/Torch/install/lib/lua/5.1/fb/python/lib.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8 stack traceback: [C]: in function 'error' ...iang/Toolkits/Torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require' main.lua:8: in main chunk [C]: in function 'dofile' ...kits/Torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk

I searched this issue on Google, it seems that the python interpreter version for fb.python module used (PyUnicodeUCS2) is not consistent with the system python interpreter version (PyUnicodeUCS4). I tried to reconfigure "fblualib" for several times, but doesn't work. Do you have any idea for this issue? Any help is appreciated!

Deqiang Xiao Biomedical Research Imaging Center (BRIC) University of North Carolina at Chapel Hill, US

AaronJackson commented 6 years ago

Hi @DeqiangXiao. Can you let me know what version of Python you are using and where you got fb.python from? If you look at the installation example in the bottom of the readme, it has a link to where to grab the dependencies from.

DeqiangXiao commented 6 years ago

The python used is python-2.7.14, i got the fb.python from https://github.com/facebook/fblualib.git, and configured it as the installation guidance in the readme file.

AaronJackson commented 6 years ago

Unfortunately I am not sure then since this appears to be an issue with your Python setup. Perhaps you could try creating a fresh Python virtual environment and install the necessary Python dependencies to see if that helps.

DeqiangXiao commented 6 years ago

OK, Thanks for your suggestion.

DeqiangXiao commented 6 years ago

Hi Aaron, I tried to reconfigure my python-2.7, but the error still occurs. I noticed that fb.python is used in face alignment which is implemented by lua originally, a python version of face alignment (https://github.com/1adrianb/face-alignment) was released recently, fb.python seems not be necessary in the python version code. So can you provide a new VRN code based on python implemented face alignment? Thanks!

AaronJackson commented 6 years ago

No, that will be too time consuming. How did you configure your Python and what OS and version are you running?

DeqiangXiao commented 6 years ago

I configured the python2.7 on a linux server with Ubuntu 14.04.5 LTS.

AaronJackson commented 6 years ago

Yes but how did you configure Python? I suggested creating a virtualenv. Did you try that?

https://virtualenv.pypa.io/en/stable/

DeqiangXiao commented 6 years ago

I configured python under my home folder, and updated the system path accordingly, but it doesn't work. I will try to configure python with virtualenv as your suggestion. Thanks very much!

AaronJackson commented 6 years ago

With virtualenv or without? If you use virtualend you just call activate and it becomes your default environment.

DeqiangXiao commented 6 years ago

Virtualenv is not used when reconfigure python under my own home folder. I'm trying to configure python with virtualenv to see if it can help.

DeqiangXiao commented 6 years ago

Hi Aaron, The 'fb.python.lib' loading error is resolved, this error is caused by torch, I updated torch and its dependences in our linux server, fbpython linking error disappeared.

AaronJackson commented 6 years ago

Good! Glad you got it working. Thanks

Jim61C commented 6 years ago

Hi!

May I know which version of torch is finally compiled to get it working? I am encountering the same issue here with the following environment.

Thanks!

DeqiangXiao commented 6 years ago

Hi @Jim61C , the latest version was used, I resolved this issue by re-installing Torch as the guide of link http://torch.ch/docs/getting-started.html#_

Jim61C commented 6 years ago

Thanks for the reply! May I know which CUDA version and cudnn are you using?

DeqiangXiao commented 6 years ago

cuda 8.0 cudnn 5.1 NVIDIA Titan Xp

Jim61C commented 6 years ago

Thank you! I will give a shot!