zhan-xu / RigNet

Code for SIGGRAPH 2020 paper "RigNet: Neural Rigging for Articulated Characters"
GNU General Public License v3.0
1.34k stars 181 forks source link

Running RigNet in python3.9 and get Aborted #76

Open WisarutBholsithi opened 1 year ago

WisarutBholsithi commented 1 year ago

I have tried to install RigNet to be used in python3.9 through the installation process:

  1. Installing the necessary library pip install numpy scipy matplotlib tensorboard open3d opencv-python pip install rtree pip install trimesh[easy]
  2. If conda had not been installed yet, installing conda and set Evironment Variable
  3. Install pytorch to the lastest version (pytorch==1.12.0) and the necessary pytorch library in the following manner: conda install pytorch==1.12.0 torchvision cudatoolkit -c pytorch pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+$cu.html pip install torch-sparse -f https://data.pyg.org/whl/torch-1.12.0+$cu.html pip install torch-cluster -f https://data.pyg.org/whl/torch-1.12.0+$cu.html pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.12.0+$cu.html pip install torch-geometric
  4. Activate Rignet through Cuda in the following manner: conda create --name rignet_cuda11 python=3.9 conda activate rignet_cuda11

To test that everything works, from the anaconda console go into RigNet-master folder and run:

python quick_start.py

However, I got Aborted result as shown here: ProblemRunningRigNet

Is there any solution for this problem? BTW, I still unable to access to get testing and training data from this website for training though.

WisarutBholsithi commented 1 year ago

Now, I have to downgrade the python used in cuda environment from python 3.9.12 to python3.7.15 to be compatible with Rignet code that use python3.7 with the following modification to allow installation of pytorch package wheels compatible with pytorch1.6 without causing the installation errors.

pip install torch-scatter==2.0.6 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html pip install torch-sparse==0.6.7 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html pip install torch-cluster==1.5.7 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html pip install torch-spline-conv==1.2.0 -f https://data.pyg.org/whl/torch-1.6.0+cu101.html pip install torch-geometric

This installation works well when I ran the command to generate dataset (python3 gen_dataset.py).

However, when I ran the code for quick start, I got a trouble with torch-geometric since the latest version of torch-geometric library (torch-geometric2.2) keeps asking for torch.profiler which is not available in pytorch 1.6 but available in pytorch1.8.1 or later. Which version of torch-geometric which is compatible with pytorch 1.6? Please help me It seems to me that torch-geometric1.7.1 is the one which is compatible with pytorch 1.6 https://pytorch-geometric.readthedocs.io/en/1.7.1/notes/installation.html

zhan-xu commented 1 year ago

Hi, I tried more recent versionS of pytorch and torch-geometric in my new project https://github.com/zhan-xu/MoRig/blob/master/environment.yml. Would you like to take a look?

WisarutBholsithi commented 1 year ago

Hi, I tried more recent versionS of pytorch and torch-geometric in my new project https://github.com/zhan-xu/MoRig/blob/master/environment.yml. Would you like to take a look?

Going to try once I have tried every measure though.

WisarutBholsithi commented 1 year ago

Hi, I tried more recent versionS of pytorch and torch-geometric in my new project https://github.com/zhan-xu/MoRig/blob/master/environment.yml. Would you like to take a look?

I have tried to install MoRig through conda environment but there must be some issues that caused the Docker container to be crashed that require reinstallation of Docker as well as ubuntu, python3.7 and conda. I has better apply manual installation steps by steps rather than using command "conda env create -f environment.yml"

WisarutBholsithi commented 1 year ago

Now, when I test the example "fbx_parser.py", I have found that this example need the Autodesk Maya API1.0 in python3. Which version of Autodesk Maya you have used which have Autodesk Maya API1.0 in python3 to be applied to your example? It seems to me that I need to install Maya2022 which has Autoesk Maya API in python3 according to this example: https://forums.autodesk.com/t5/maya-programming/openmaya-in-anaconda3-with-jupiter-notebook/td-p/11008233

zhan-xu commented 1 year ago

I have used this script in Maya 2018. I have also used Maya 2020, 2022 recently with functions in there, and I didn't have problem. Are you using Jupiter Notebook? I used the script editor within Maya.

WisarutBholsithi commented 1 year ago

I have used this script in Maya 2018. I have also used Maya 2020, 2022 recently with functions in there, and I didn't have problem. Are you using Jupiter Notebook? I used the script editor within Maya.

BTW, I just wonder how did you run your code with the use of python library of Maya 2018 and later version in Windows or in Linux (Ubuntu). If it is in Linux (Ubuntu), I just wonder how did you do this kind of thing since I'm trying to run your code in Docker that use Ubuntu in the container.

zhan-xu commented 1 year ago

I've been using Maya in Windows. I assume you mean numpy and scipy? you can check https://forums.autodesk.com/t5/maya-programming/guide-how-to-install-numpy-scipy-in-maya-windows-64-bit/td-p/5796722

basically you can install any library using the pip from mayapy.

WisarutBholsithi commented 1 year ago

I've been using Maya in Windows. I assume you mean numpy and scipy? you can check https://forums.autodesk.com/t5/maya-programming/guide-how-to-install-numpy-scipy-in-maya-windows-64-bit/td-p/5796722

basically you can install any library using the pip from mayapy.

Well, after I have counterchecked into your python wheel and 7z files along with the application of command "mayapy -m pip list", I got the list of necessary library files as follows:

  1. llvmlite==0.20.0 . However, the compatibility issues with python3.7 has compelled me to use command "conda install llvmlite==0.38.0" instead
  2. numba==0.35.0 However, the compatibility issues with python3.7 has compelled me to use command "conda install numba==0.55.1" instead
  3. pyHook==1.5.1 This one is unresolved issue even after downloadining pyHook-1.5.1-cp37-cp37m-win_amd64.whl before applying the command "pip install --no-deps pyHook-1.5.1-cp37-cp37m-win_amd64.whl" and still failed to install
  4. numexpr==2.6.2 However, the compatibility issues with python3.7 has compelled me to use command "conda install numexpr==2.8.4" so that I do not have to downgrade numpy library in comparison with the case of "conda install numexpr==2.7.0"
  5. scipy==0.19.0 However, the compatibility issues with python3.7 has compelled me to the existing version which is scipy==1.7.3
  6. numpy==1.13.1 However, the compatibility issues with python3.7 has compelled me to the existing version which is numpy==1.21.5
  7. future==0.18.2 - no problem of installing with command "future==0.18.2"
  8. pip==20.2.2 - better use the existing version which is pip==22.3.1
  9. pymel==1.2.0 However, the compatibility issues with python3.7 has compelled me to use command "pip install --no-deps pymel" to make successfu installation as pymel==1.2.0
  10. PySide2==5.15.2 However, the compatibility issues with python3.7 has compelled me to use command "pip install --no-deps PySide2" to make successful installation as PySide2==5.15.2.1
  11. setuptools==41.2.0 - better use the existing version which is setuptools==65.5.0
  12. shiboken2==5.15.2However, the compatibility issues with python3.7 has compelled me to use command "pip install --no-deps shiboken2" to make successful installation as shiboken2==5.15.2.1
  13. shiboken2-generator==5.15.2 However, the compatibility issues with python3.7 has compelled me to use command "pip install \ --index-url=http://download.qt.io/official_releases/QtForPython/ \ --trusted-host download.qt.io \ shiboken2 pyside2 shiboken2_generator" to make successful installation as shiboken2-generator==5.15.2.1
WisarutBholsithi commented 1 year ago

BTW, I have already followed the instruction to install Python packages shown in mayapy before setting up File path variables for Maya, Initializing the Maya Environment in and for Python along with Setting environment variables using Maya.env as the way to set path to access into Maya API 1.0.

However, I still get the following error when I run the command python fbx_parser.py, and still getting the folowing error:

  File "fbx_parser.py", line 1, in <module>
    import maya.OpenMaya as om
ModuleNotFoundError: No module named 'maya'

Did I do something wrong with my environment variable setting?

What is your way to set up environment variables so python.exe in C:\Users[user_name].conda\envs\rignet could manage to access Maya API in C:\Program Files\Autodesk\Maya2022\Python37\Lib\site-packages without troubles. Please help me.

zhan-xu commented 1 year ago

I see the problem. For fbx_parser.py, I was using mayapy, which is python shipped within maya, not the one in conda env. You can run fbx_parser.py in maya's scriptor editor.