athn-nik / teach

Official PyTorch implementation of the paper "TEACH: Temporal Action Compositions for 3D Humans"
https://teach.is.tue.mpg.de
Other
383 stars 40 forks source link

run interact_teach.py error #29

Closed jliuliu closed 1 year ago

jliuliu commented 1 year ago

cmd: python interact_teach.py folder=/teach output=/teach texts='jump with left root' durs='[2]'

Error executing job with overrides: ['folder=/teach', 'output=/teach', 'texts=jump with left root', 'durs=[2]'] Traceback (most recent call last): File "/teach/interact_teach.py", line 35, in _interact return interact(cfg) File "/teach/interact_teach.py", line 58, in interact model = instantiate(cfg.model, omegaconf.errors.ConfigAttributeError: Key 'model' is not in struct full_key: model object_type=dict

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

It seems that key "model" is not includeed in the configure file configs/interact_teach.yaml

athn-nik commented 1 year ago

Can you try giving it a list of texts? like texts=['some action description']. The model is inside .hydra config if you download as I describe in my instructions.

ps: I assume you want to correct root for foot [?], also you really want to save the sample in you / directory and not your ./ ?

jliuliu commented 1 year ago

Hi, Thanks for your reply, follow your instructions:

  1. I just replace a list of texts, but still same error.
  2. I repull the latest code from github by git clone https://github.com/athn-nik/teach.git, but I not found .hydra in working dir
  3. I mkdir .hydra, and copy configs/interact_teach.yaml to .hydra, so config.yaml is:

hydra: run: dir: . output_subdir: null

seed: 1234

folder: ??? # the fps used during training texts: ??? output: ??? durs:

  • 1
  • 1.5
  • 2
  • 3
  • 4
  • 5 train_fps: 30 last_ckpt_path: \$ {get_last_checkpoint:\${folder}} samples: 1 logger_level: INFO slerp_ws: 8

# joints / vertices / smpl repr_type: 'smpl'

# Composing nested config with default defaults:

  • data: null
  • machine: server
  • trainer: null
  • pose2joints: null
  • sampler: all_conseq
  • /path@path
  • override hydra/job_logging: custom
  • override hydra/hydra_logging: custom
  • self

data.batch_size: 1

  1. download from website, I found 3 last.ckpt, and I'm not sure where to put it, thanks
athn-nik commented 1 year ago

Ah, I see now. You must follow the detailed instructions in the README to be able to run it. You need a checkpoint and a configuration. Please look here. After downloading the teach checkpoints and configuration you must put them in a folder that looks like:

experiment
│   
└───.hydra
│   | config.yaml
|   | overrides.yaml
|   | hydra.yaml
|
└───checkpoints
    │   last.ckpt
athn-nik commented 1 year ago

In the website there are the Joint Independent and TEACH checkpoints.

jliuliu commented 1 year ago

Thanks, I solved above problem, but I met new problem like this:

Traceback (most recent call last): File "/teach/interact_teach.py", line 109, in _interact() File "/opt/conda/lib/python3.10/site-packages/hydra/main.py", line 48, in decorated_main _run_hydra( File "/opt/conda/lib/python3.10/site-packages/hydra/_internal/utils.py", line 377, in _run_hydra run_and_report( File "/opt/conda/lib/python3.10/site-packages/hydra/_internal/utils.py", line 294, in run_and_report raise ex File "/opt/conda/lib/python3.10/site-packages/hydra/_internal/utils.py", line 211, in run_and_report return func() File "/opt/conda/lib/python3.10/site-packages/hydra/_internal/utils.py", line 378, in lambda: hydra.run( File "/opt/conda/lib/python3.10/site-packages/hydra/internal/hydra.py", line 111, in run = ret.return_value File "/opt/conda/lib/python3.10/site-packages/hydra/core/utils.py", line 233, in return_value raise self._return_value File "/opt/conda/lib/python3.10/site-packages/hydra/core/utils.py", line 160, in run_job ret.return_value = task_function(task_cfg) File "/teach/interact_teach.py", line 35, in _interact return interact(cfg) File "/teach/interactteach.py", line 104, in interact vid = visualize_meshes(motion) File "/teach/teach/render/mesh_viz.py", line 115, in visualize_meshes m_rec = trimesh.Trimesh(vertices=mesh_rec[i], File "/opt/conda/lib/python3.10/site-packages/trimesh/base.py", line 192, in init self.process(validate=validate, kwargs) File "/opt/conda/lib/python3.10/site-packages/trimesh/base.py", line 228, in process self.merge_vertices(kwargs) File "/opt/conda/lib/python3.10/site-packages/trimesh/base.py", line 1117, in merge_vertices grouping.merge_vertices(self, **kwargs) File "/opt/conda/lib/python3.10/site-packages/trimesh/grouping.py", line 63, in merge_vertices referenced[mesh.faces] = True IndexError: index 9259 is out of bounds for axis 0 with size 6890

data
|-- amass
|  -- your-processed-amass-data 
|
|-- babel
|   -- babel-teach
|       `...
|   -- babel-smplh-30fps-male 
|       ...
|
|-- smpl_models
|   -- smplh
|       --SMPLH_MALE.pkl
|   -- smpl **(NEW)**
|       -- SMPL_NEUTRAL.pkl  **(NEW)**

I add smpl/SMPL_NEUTRAL.pkl, because /teach/teach/render/mesh_viz.py, line 79: smpl = get_body_model(path=f'{get_original_cwd()}/data/smpl_models',model_type='smpl', gender='neutral', batch_size=1, device='cpu')

So, I suspect a mismatch between generate vertices and smpl model .

athn-nik commented 1 year ago

Hmm, I see that you are using conda and not virtualenv and also python3.9. Let's try top debug this, but it is always better to follow the official instructions so I can handle it on my machine also. I am using SMPLH_MALE, no need to actually use smplh because the visualization function takes the vertices directly. Can you try printing the shape of mesh_rec, and also make sure that you have pull my latest changes.

athn-nik commented 1 year ago

Seems inactive for quite a while @jliuliu . Let me know if I should take action or close this

jliuliu commented 1 year ago

it's ok, thanks very much