Skip to content
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

neutral model #4

Closed
ghumpire opened this issue Jun 17, 2020 · 7 comments
Closed

neutral model #4

ghumpire opened this issue Jun 17, 2020 · 7 comments

Comments

@ghumpire
Copy link

Hi,

I ran the demo but got the assertion indicating that the data/smpl/SMPL_NEUTRAL.pkl does not exist. Then I noticed the fetch data section indicates that the 'neutral model' (http://smplify.is.tue.mpg.de/) is needed for training, evaluation, and running the demo code. That website contains multiple files, Could you please confirm if that model is the one located on lsp_results.targ.gz (obtained from http://smplify.is.tue.mpg.de/) > results > lsp > all_results_gender-neutral.pkl? If so, I would have to rename all_results_gender-neutral.pkl as SMPL_NEUTRAL.pkl. After renaming the pkl, the code returned the error below, which makes me think I got the wrong pkl:

File "/multiperson/mmdetection/mmdet/models/utils/smpl/smpl.py", line 51, in __init__
    super(SMPL, self).__init__(*args, create_global_orient=False, create_body_pose=False, create_betas=False, create_transl=False, **kwargs)
  File "/python3.6/site-packages/smplx/body_models.py", line 205, in __init__
    self.faces = data_struct.f
AttributeError: 'Struct' object has no attribute 'f'

Cheers,
Gabriel

@manlio99
Copy link

Hey i had a related mistake, i didn't solve it yet.
i think that I'm forgetting something.... can u help me?

console:

/home/massiris/miniconda3/envs/multiperson/bin/python3.7 /home/massiris/Desktop/python/3dpose/multiperson/mmdetection/tools/demo.py
unexpected key in source state_dict: fc.weight, fc.bias

missing keys in source state_dict: layer2.0.bn2.num_batches_tracked, layer2.2.bn3.num_batches_tracked, layer2.2.bn1.num_batches_tracked, layer2.0.downsample.1.num_batches_tracked, layer3.0.bn3.num_batches_tracked, layer1.1.bn1.num_batches_tracked, layer4.1.bn3.num_batches_tracked, layer2.1.bn2.num_batches_tracked, layer2.2.bn2.num_batches_tracked, layer3.0.bn1.num_batches_tracked, layer4.0.bn2.num_batches_tracked, layer4.2.bn1.num_batches_tracked, layer3.5.bn3.num_batches_tracked, layer3.4.bn1.num_batches_tracked, layer4.2.bn2.num_batches_tracked, layer3.1.bn2.num_batches_tracked, layer1.1.bn2.num_batches_tracked, layer3.1.bn1.num_batches_tracked, layer4.0.downsample.1.num_batches_tracked, layer1.0.bn3.num_batches_tracked, layer3.1.bn3.num_batches_tracked, layer2.3.bn1.num_batches_tracked, layer3.4.bn2.num_batches_tracked, layer3.2.bn2.num_batches_tracked, layer3.4.bn3.num_batches_tracked, layer3.2.bn3.num_batches_tracked, layer3.3.bn2.num_batches_tracked, layer4.1.bn1.num_batches_tracked, layer4.0.bn1.num_batches_tracked, layer2.0.bn3.num_batches_tracked, layer1.2.bn2.num_batches_tracked, bn1.num_batches_tracked, layer3.3.bn3.num_batches_tracked, layer3.5.bn1.num_batches_tracked, layer1.1.bn3.num_batches_tracked, layer2.0.bn1.num_batches_tracked, layer3.3.bn1.num_batches_tracked, layer1.0.downsample.1.num_batches_tracked, layer4.2.bn3.num_batches_tracked, layer1.2.bn3.num_batches_tracked, layer2.1.bn3.num_batches_tracked, layer4.0.bn3.num_batches_tracked, layer2.3.bn3.num_batches_tracked, layer4.1.bn2.num_batches_tracked, layer2.3.bn2.num_batches_tracked, layer3.0.bn2.num_batches_tracked, layer3.2.bn1.num_batches_tracked, layer1.0.bn1.num_batches_tracked, layer3.5.bn2.num_batches_tracked, layer1.0.bn2.num_batches_tracked, layer1.2.bn1.num_batches_tracked, layer3.0.downsample.1.num_batches_tracked, layer2.1.bn1.num_batches_tracked

2020-06-22 16:09:39,883 - INFO - load checkpoint from /home/massiris/Desktop/python/3dpose/multiperson/mmdetection/data/checkpoint.pt
2020-06-22 16:09:40,274 - WARNING - missing keys in source state_dict: smpl_head.smpl.lbs_weights, smpl_head.loss.smpl.v_template, smpl_head.smpl.parents, smpl_head.loss.smpl.faces_tensor, smpl_head.loss.smpl.posedirs, smpl_head.smpl.posedirs, smpl_head.loss.smpl.vertex_joint_selector.extra_joints_idxs, smpl_head.loss.smpl.shapedirs, smpl_head.loss.smpl.parents, smpl_head.loss.smpl.J_regressor_extra, smpl_head.smpl.J_regressor, smpl_head.smpl.v_template, smpl_head.smpl.faces_tensor, smpl_head.smpl.vertex_joint_selector.extra_joints_idxs, smpl_head.loss.smpl.lbs_weights, smpl_head.smpl.shapedirs, smpl_head.smpl.J_regressor_extra, smpl_head.loss.smpl.J_regressor

Traceback (most recent call last):
File "/home/massiris/Desktop/python/3dpose/multiperson/mmdetection/tools/demo.py", line 199, in
main()
File "/home/massiris/Desktop/python/3dpose/multiperson/mmdetection/tools/demo.py", line 158, in main
runner.resume(cfg.resume_from)
File "/home/massiris/miniconda3/envs/multiperson/lib/python3.7/site-packages/mmcv/runner/runner.py", line 313, in resume
self.optimizer.load_state_dict(checkpoint['optimizer'])
File "/home/massiris/miniconda3/envs/multiperson/lib/python3.7/site-packages/torch/optim/optimizer.py", line 115, in load_state_dict
raise ValueError("loaded state dict contains a parameter group "
ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group

Process finished with exit code 1

@sleep3r
Copy link

sleep3r commented Jul 2, 2020

@ghumpire, @manlio99

Docker image I used - nvidia/cudagl:10.0-devel-ubuntu16.04

Server preparations

apt-get update
apt-get install sudo git wget unzip -y
sudo apt-get install build-essential libglib2.0-0 libsm6 libxext6 libxrender-dev -y
sudo apt-get install libglfw3-dev libgles2-mesa-dev -y

In case you have no anaconda installed

wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
bash Anaconda3-2020.02-Linux-x86_64.sh

Some checks

gcc --version
nvcc -V
conda
git clone https://github.com/JiangWenPL/multiperson.git

cd multiperson/
conda env create -f environment.yml
source activate multiperson
cd neural_renderer/
python3 setup.py install
cd ../mmcv
python3 setup.py install
cd ../mmdetection
./compile.sh
python setup.py develop

cd ../sdf
python3 setup.py install

Data fetching

cd ../mmdetection/
mkdir data
mkdir results
cd data
pip install gdown

gdown https://drive.google.com/uc?id=1y5aKzW9WL42wTfQnv-JJ0YSIgsdb_mJn
tar xf multiperson_data.tar -C ~/multiperson/mmdetection/data
wget https://people.eecs.berkeley.edu/~kanazawa/cachedir/hmr/neutral_smpl_mean_params.h5 --no-check-certificate

Downloading the SMPL model from my Google Drive

gdown https://drive.google.com/uc?id=<someId>
unzip smpl.zip

Downloading neutral model .pkl from smplify_code_v2.zip

cd smpl
gdown https://drive.google.com/uc?id=<anotherId>

According to #1

rm -rf /root/anaconda3/envs/multiperson/lib/python3.7/site-packages/mmcv*
cd ../mmcv
python3 setup.py install

Now can run it

cd ~/multiperson/mmdetection/
python3 tools/demo.py --config=configs/smpl/tune.py --image_folder=demo_images/ --output_folder=results/ --ckpt data/checkpoint.pt

@Anirudh257
Copy link

@eladwass I didn't perform the upgrade from Python 2 to Python 3 but I followed the steps outlined by @sleep3r and my code ran.

@eladwass
Copy link

eladwass commented Aug 26, 2020

Hi

I successfully downloaded :
"Downloading neutral model .pkl from smplify_code_v2.zip"

But what exactly do u download here:
"Downloading the SMPL model from my Google Drive" -
I took the PKL from the models folder inside the smplify_code_v2.zip

I performed the steps @sleep3r did but tackled the following:
ImportError: cannot import name 'ModelOutput' from 'smplx.body_models'

To overcome this I replaced the above line with:
from smplx.body_models import SMPLXOutput
in "/multiperson/mmdetection/mmdet/models/utils/smpl/smpl.py"

@seyeeet
Copy link

seyeeet commented Nov 18, 2020

@eladwass Thank you! It helps me a lot!
Can you tell me what it does when you replace it with SMPLOutput? what is the difference and how did you figure it out 🥇

@Dingpx
Copy link

Dingpx commented Sep 29, 2021

@sleep3r I can't find the data you outlined.

  1. SMPL model 2. neutral model .pkl
    Could you tell me how to find it?

@JiangWenPL
Copy link
Owner

Should be resolved in the latest updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants