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

How to run the demo? #6

Closed opentld closed 1 year ago

opentld commented 1 year ago

Did someone successfully run the demo? What's wrong with my commands? image Who can give an example of a correct run of demo?

opentld commented 1 year ago

(teach-env) D:\SourceCodes\Pose\3D\teach>python interact_teach.py folder=./ output=./ texts=run durs=3 Global seed set to 1234 [07/10/22 23:05:26][main][INFO] - Loading model Error executing job with overrides: ['folder=./', 'output=./', 'texts=run', 'durs=3'] Traceback (most recent call last): File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, **kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\text_hist.py", line 39, in init super().init(modelpath=modelpath, finetune=finetune) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\distilbert.py", line 41, in init rel_p = rel_p[rel_p.index('deps'):] ValueError: 'deps' is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\model\teach.py", line 51, in init self.textencoder = instantiate(textencoder, nfeats=nfeats) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 180, in instantiate return instantiate_node(config, args, recursive=recursive, convert=convert) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 249, in instantiate_node return _call_target(target, args, kwargs) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 64, in _call_target raise type(e)( File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, **kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\text_hist.py", line 39, in init super().init(modelpath=modelpath, finetune=finetune) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\distilbert.py", line 41, in init rel_p = rel_p[rel_p.index('deps'):] ValueError: Error instantiating 'teach.model.textencoder.text_hist.TextHist' : 'deps' is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\SourceCodes\Pose\3D\teach\interact_teach.py", line 35, in _interact return interact(cfg) File "D:\SourceCodes\Pose\3D\teach\interact_teach.py", line 57, in interact model = instantiate(cfg.model, File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 180, in instantiate return instantiate_node(config, args, recursive=recursive, convert=convert) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 249, in instantiate_node return _call_target(target, args, kwargs) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 64, in _call_target raise type(e)( File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\model\teach.py", line 51, in init self.textencoder = instantiate(textencoder, nfeats=nfeats) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 180, in instantiate return instantiate_node(config, args, recursive=recursive, convert=convert) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 249, in instantiate_node return _call_target(target, args, kwargs) File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 64, in _call_target raise type(e)( File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\text_hist.py", line 39, in init super().init(modelpath=modelpath, finetune=finetune) File "D:\SourceCodes\Pose\3D\teach\teach\model\textencoder\distilbert.py", line 41, in init rel_p = rel_p[rel_p.index('deps'):] ValueError: Error instantiating 'teach.model.teach.TEACH' : Error instantiating 'teach.model.textencoder.text_hist.TextHist' : 'deps' is not in list

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

athn-nik commented 1 year ago

Hello @opentld , I fixed the link you can now access it, or click in the top of the readme where is a button for the website. Sign up to access the download section. Download the required files by clicking on the corresponding link (eg. TEACH) then unzip it and put its contents in a folder. This folder is supposed to be given in the folder argument for the interact_teach.py script. Those will be used to initialize the configuration and load the checkpoint.

Then, you can run the demo :)

opentld commented 1 year ago

I got the .hydra/config.yaml and checkpoints/last.ckpt,and put pkl into data folder like this: image but another error occurs:

(teach-env) D:\SourceCodes\Pose\3D\teach>python interact_teach.py folder=./ output=./ texts=run durs=3 Global seed set to 1234 [08/10/22 00:05:02][main][INFO] - Loading model Error executing job with overrides: ['folder=./', 'output=./', 'texts=run', 'durs=3'] Traceback (most recent call last): File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\hydra_internal\instantiate_instantiate2.py", line 62, in _call_target return target(*args, **kwargs) File "D:\SourceCodes\Pose\3D\teach\teach\transforms\rots2joints\smplh.py", line 58, in init self.smplh = SMPLHLayer(path, ext="pkl", gender=gender).eval() File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\smplx\body_models.py", line 761, in init super(SMPLHLayer, self).init( File "D:\DevelopTools\anaconda3\envs\teach-env\lib\site-packages\smplx\body_models.py", line 601, in init left_hand_components = data_struct.hands_componentsl[:num_pca_comps] AttributeError: 'Struct' object has no attribute 'hands_componentsl'

athn-nik commented 1 year ago

You have to follow the procedure described here in the last comment to get the right SMPLH_MALE model. I should include this in the repo.

opentld commented 1 year ago

I'm using windows10 and Anaconda, so I have to make some change like this: image This is because the path separator for Windows is different from Linux, so I have to convert '\' to '/' and, in mesh_viz.py, comment out the code os.environ['PYOPENGL_PLATFORM'] = 'egl' ,because windows does not support EGL. After the above operations, the code runs.

(teach-env) D:\SourceCodes\Pose\3D\teach>python interact_teach.py folder=./ output=./outputs/ texts=[run,walk] durs=[5,5] Global seed set to 1234 [08/10/22 10:55:46][main][INFO] - Loading model [08/10/22 10:55:47][main][INFO] - Model 'teach' loaded [08/10/22 10:55:48][main][INFO] - Model weights restored Global seed set to 0 WARNING: You are using a SMPL+H model, with only 10 shape coefficients.

How about the WARRNING? Is it because I change the code in mesh_viz.py ? smpl = get_body_model(path=f'{get_original_cwd()}/data/smpl_models', model_type='smplh', gender='male', batch_size=1, device='cpu') I can't find the smpl_neutral.pkl, so I used smplh_male.pkl instead.

athn-nik commented 1 year ago

Yes, you are right the code has been tested on Ubuntu 20.04. You should use the male model as you can see in the config. The warning caused by smplx package. It is not something you should worry about. It just notifies you about the shape parameters used which are not important for this project.

athn-nik commented 1 year ago

I will keep this open, update the instructions and close this after. Let me know if you face any other problem.

pfeducode commented 1 year ago

An error occurred in opengl. I don't know why? 2022-10-11_19-46 2022-10-11_19-47

athn-nik commented 1 year ago

Hmmm, I am not sure at all. But can you try adding this line after package imports? os.environ['PYOPENGL_PLATFORM'] = 'egl' and let me know if it works.

pfeducode commented 1 year ago

Hmmm, I am not sure at all. But can you try adding this line after package imports? os.environ['PYOPENGL_PLATFORM'] = 'egl' and let me know if it works.

NO, it does not work. I think it's because of the version of opengl. I suggest using a more compatible pytorch3d

athn-nik commented 1 year ago

Can you try again using my environment? (i.e. no conda) Just follow the README instructions. Run this: source scripts/install.sh and will create and activate the environment automatically for you then run the code and check if there is a bug. Sorry, but I do not trust conda.

pfeducode commented 1 year ago

Can you try again using my environment? (i.e. no conda) Just follow the README instructions. Run this: source scripts/install.sh and will create and activate the environment automatically for you then run the code and check if there is a bug. Sorry, but I do not trust conda.

no,it does not work, I have this problem in other projects. I think it's problem of PyOpenGL

zhuangzhuang000 commented 1 year ago

hello! I have obtained the SMPLH_MALE.pkl, but it is shown here that is required SMPL_NEUTRAL.pkl, where should I get it?

image

FusionLi commented 1 year ago

@opentld Did you change the path separator on Windows for every file?

athn-nik commented 1 year ago

@zhuangzhuang000 you can obtain it here. I have fixed it to use smplh male model. You can either download smpl neutral or pull my changes

athn-nik commented 1 year ago

I have tested the solution, it works only with smplh now so it should be good to go