-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation: Environment Setup | File/ Directory Structure #186
Comments
@Jeff-sjtu : Please have a look at the environment setup instructions. If they work across a few other machiens, you can update the README accordingly. Also check out the Directory Structure section. Adding those to the README might also be helpful |
Checking in. Windows 10, Xeon E3 V5, 16GB ram, RTX 3060 Ti. About a week ago I was trying to run hybrik with no luck. I figured out that I needed to run python 3.9 and got pytorch3d installed. Did the numpy thing as well. Kept getting the opencv error so I tried uninstalling openCV and reinstalling several different versions. Still didn't get it to work. The thing I missed that this guy helped me with was to delete openCV from the setup file. That enabled it to work. The main difference that I had in the setup was that I ran CUDA 11.7. Installing CUDA 11.6 would get stuck at solving. Also the cub install couldn't be found but CUDA 11.7 doesn't need cub. I used this command. conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia And this for pytorch3d pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable" Thanks for the help. Anybody know about running Hybrik-X? I tried and get an error about a .pk file or something. Also, What is the difference? Is Hybrik-X faster and uses GPU or better results or what? |
Glad that it helped. Thanks for sharing your suggestions also. Regarding your query about Hybrik-X - Hybrik-X regresses smpl-x parameters, while Hybrik regresses smpl parameters. smpl-x was a follow up work to smpl with information for more joints specifically, for the hand and face. You can read about smpl-x here |
Ok. Are you able to run hybrik-x? I get an error about save.pk. What needs to be changed to run hybrik-x? Thanks |
Hey Amogh, thank you for such a prompt explanation for the setup. 😁 It would be great if you can clarify a question of mine regarding the dataset. I wish to train HyBrik on my custom dataset but I need to setup the annotation files in a correct structure and have to include the necessary things to avoid any failed trainings. Could you maybe quickly brief on the things which are necessary. Currently I have the following: Also how should the annotation structure be in case you know this. it will be wonderful since the 3 processed dataset given in this repo, follow different structure. So am confused which one to follow. Hope to hear from you soon |
Hi, I followed the instructions to set the environment and install pytorch3d, but when I try to install it using conda I get conflicts. The following specifications were found to be incompatible with your system:
Your installed version is: 2.31 |
Thank you for the response, I got another question. I have my own data and wish to train hybrik but it has 18-25 joints like openpose 😅 so kinda in the mid state if hybrik is the right choice. Could you inform me @sebastianopazo1 |
conda install pytorch3d -c pytorch3d .. which channel is this on ? |
Get the latest one, mostly from forge. Or install via pip |
i used instead of ssh . that worked |
It helped a lot, thanks for your contribution @AmoghTiwari ! I should add that I had an error:
I fixed it by downgrading numpy using |
I faced some trouble while trying to setup the environment to run the code. Specially, with pytorch3d. So I am sharing the steps using which I was able to finally set up the code. Note that, till now I have only tried out the demo code. So I still can't confirm if the below steps will be sufficient for running the training code also. Also, if this doesn't work, please be sure to look at other comments also (for example, it worked for me with cuda 11.6, while someone else has shared there suggestions below that it worked for them with cuda 11.7).
System Details: Ubuntu 18.04 with 4 Nvidia 2080 Ti (Remote server)
Environment Setup
Note: Steps: 1-4 did not work for me. So you might want to directly jump to step-5
Try following the repo's official installation instructions. If they work, great!
If you face an issue in step-5, when running
python setup.py develop
, try usingpip install -e .
(from the root directory) instead. The latter works for me. The former doesn'tIf you face an issue in step-2 (pytorch installation), look up the following link: https://pytorch.org/get-started/previous-versions/ and try installing the the version applicable to you. (Note the installation command for OSX/Linux/Windows might vary. So be careful to choose the right command).
If you face an issue in step-3 (pytorch3d installation), Check if pytorch got installed succesfully:
python -c "import torch
; If this doesn't run, it means torch is not installed properly. If this runs, try this -python -c "import torch; print(torch.cuda.is_available())"
. If you have a gpu based system, and want to use a gpu, this should print "True" on your terminal. If you do not have a gpu, then it should print false. If you have a gpu and it still prints false (and assuming your gpu is working properly), then it means that even though pytorch is installed, only its cpu version is installed. In that case, try installing the gpu enabled version of pytorch (refer step-3)B. If pytorch is installed properly, but pytorch3d isn't you can try installing pytorch3d with pip or conda
pip install pytorch3d
/conda install -c pytorch3d pytorch3d
. However, if none of these work (which happenned to be the case for me, see step-5You might want to try following the repo's official instructions first (see steps 1-4) before coming to this step. But if following the repo's official instructions does not work (which happenned to be the case for me), then below are the steps which finally worked out for me. Note - there will be some deviation from the repo's official instructions in the below steps
A. Install pytorch3d by following their official instructions: https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md . Specifically, I did the following:
B.
pip install -e .
(from the root directory)C. If you get an error while installing openCV after the above command, open the
setup.py
file, go to line 124, and from theinstall_requires
list, remove theopencv-python==4.1.2.30
part, install openCV separately usingpip install opencv-python
and then again runpip install -e .
(from the root directory) And hope that it gets built properly I was able to solve the environment related issues using the above stepsD. Assuming that the above works, now, if you get some error while running the demo code, the most likely culprits are:
(i) Improperly installed pytorch and pytorch3d. To check this, first check if pytorch is installed properly (see step-4 for details on how you can check this). Then, check if pytorch3d is installed properly by using
python -c "import pytorch3d"
; (ii) Numpy version error (Check #184 for a fix). (iii) Some missing pretrained models/files, check the next section for this;Directory structure
The directory structure looks like this
Within this,
pretrained_models
directory looks like thisThe above pretrained models can be downloaded from here as suggested in the installation instructions. After downloading the models, I create a symlink named
hybrik_hrnet.pth
which links it tohybrik_hrnet48_w3dpw.pth
. I did this because the code expects a file namedhybrik_hrnet.pth
but that wasn't available in the downloaded pretrained files. Hence I created this symlink and it worked. (If you are not familiar with symlinks, you can just renamehybrik_hrnet48_w3dpw.pth
tohybrik_hrnet.pth
). Please refer to #185 for more discussion on this.The
model_files
directory looks like thisHere, the smplx files were downloaded from smpl-x's website, the
basicModel_neutral_lbs_10_207_0_v1.0.0.pkl
from smplify's website, thesmplx_kid_template.npy
from agora's websiteFor
J_regressor_h36m.npy
andh36m_mean_beta.npy
, I first downloaded the necessary files using this script, following SPEC's instructions. (Note this downloads some extra files. We only needJ_regressor_h36m.npy
andsmpl_mean_params.npz
from this.The script shared above, downloads
smpl_mean_params.npz
while this repo needsh36m_mean_beta.npy
. To geth36m_mean_beta.npy
fromsmpl_mean_params.npz
, I got the mean betas from thesmpl_mean_params.npz
file and dumped it as anpy
file in themodel_files
directory. This can be done as followsAfter this, move the
h36m_mean_beta.npy
to the right location inside themodel_files
directory.After this, I ran
python scripts/demo_video.py --video-name examples/dance.mp4 --out-dir res_dance --save-pk --save-img
as suggested in the official instructions, and it worked for me. Hope it works for you too. Best of luck!The text was updated successfully, but these errors were encountered: