MotionGPT icon indicating copy to clipboard operation
MotionGPT copied to clipboard

ValueError: not enough values to unpack (expected 2, got 0)

Open marybloodyzz opened this issue 2 years ago • 17 comments

Hi, I got this issue even after unzip the texts.zip file. Traceback (most recent call last): File "/home/zzmarybloody/MotionGPT/demo.py", line 237, in main() File "/home/zzmarybloody/MotionGPT/demo.py", line 147, in main datamodule = build_data(cfg) File "/home/zzmarybloody/MotionGPT/mGPT/data/build_data.py", line 10, in build_data return instantiate_from_config(data_config) File "/home/zzmarybloody/MotionGPT/mGPT/config.py", line 42, in instantiate_from_config return get_obj_from_str(config["target"])(**config.get("params", dict())) File "/home/zzmarybloody/MotionGPT/mGPT/data/HumanML3D.py", line 76, in init self._sample_set = self.get_sample_set(overrides={"split": "test", "tiny": True}) File "/home/zzmarybloody/MotionGPT/mGPT/data/init.py", line 20, in get_sample_set return self.DatasetEval(**sample_params) File "/home/zzmarybloody/MotionGPT/mGPT/data/humanml/dataset_t2m_eval.py", line 24, in init super().init(data_root, split, mean, std, max_motion_length, File "/home/zzmarybloody/MotionGPT/mGPT/data/humanml/dataset_t2m.py", line 165, in init name_list, length_list = zip( ValueError: not enough values to unpack (expected 2, got 0)

marybloodyzz avatar Nov 03 '23 19:11 marybloodyzz

Me too! I also want to know how to solve it!

QvQKing avatar Nov 07 '23 07:11 QvQKing

same problem

santurini avatar Dec 03 '23 19:12 santurini

Hi @lzhyu, I tried your solution but keep having the same error, my folder structure is like this: image

Could you tell me how you downloaded the dataset?

santurini avatar Dec 04 '23 10:12 santurini

Hi @lzhyu, I tried your solution but keep having the same error, my folder structure is like this: image

Could you tell me how you downloaded the dataset?

I followed the official HumanML3D pipeline. My folder looks the same as yours. I guess the reason why some error is hidden is they used an exception handler in mGPT/data/humanml/dataset_t2m.py. I would suggest printing out variables to check the details.

lzhyu avatar Dec 04 '23 16:12 lzhyu

I was able to solve this problem but now I have problems in building the model. Do you have shape mismatch when loading the pretrained mGPT?

santurini avatar Dec 05 '23 09:12 santurini

The issue you're encountering is most likely related to missing data. By default, we save all data into a single temporary data file for faster I/O operations. You can try resolving it by deleting the "tmp" folder within your dataset folder and then attempting the operation again.

billl-jiang avatar Dec 06 '23 03:12 billl-jiang

@billl-jiang Yes, I was able to solve this issue, but now I have a shape mismatch in the model parameters when loading the state dict.

santurini avatar Dec 06 '23 09:12 santurini

@billl-jiang Yes, I was able to solve this issue, but now I have a shape mismatch in the model parameters when loading the state dict.

Hi, could you tell me how you solved the problem? thx 😊

Yawningx avatar Dec 07 '23 01:12 Yawningx

@Yawningx I asked the authors of HumanML3D for the zipped dataset and then unzipped texts.zip.

For me it worked, while for the second problem there is row 77 inmGPT.data.HumanML3D.HumanML3DDataModule that changes incorrectly the cfg.DATASET.NFEATURES, so I just hard-coded it to 263.

santurini avatar Dec 07 '23 11:12 santurini

@Yawningx I asked the authors of HumanML3D for the zipped dataset and then unzipped texts.zip.

For me it worked, while for the second problem there is row 77 inmGPT.data.HumanML3D.HumanML3DDataModule that changes incorrectly the cfg.DATASET.NFEATURES, so I just hard-coded it to 263.

Thanks for your reply! But the error still exist, my HumanML3D folder has structure as follows: 1701953381452 First I unzip the texts.zip, then I put the instructions data in prepare/instructions to the same folder of HumanML3D dataset, as it said in README.md. Did I miss sth important?

Yawningx avatar Dec 07 '23 12:12 Yawningx

@Yawningx I asked the authors of HumanML3D for the zipped dataset and then unzipped texts.zip. For me it worked, while for the second problem there is row 77 inmGPT.data.HumanML3D.HumanML3DDataModule that changes incorrectly the cfg.DATASET.NFEATURES, so I just hard-coded it to 263.

Thanks for your reply! But the error still exist, my HumanML3D folder has structure as follows: 1701953381452 First I unzip the texts.zip, then I put the instructions data in prepare/instructions to the same folder of HumanML3D dataset, as it said in README.md. Did I miss sth important?

trycp -r prepare/instructions datasets/HumanML3D

Coco-XiangLi avatar Jan 25 '24 02:01 Coco-XiangLi

@billl-jiang Yes, I was able to solve this issue, but now I have a shape mismatch in the model parameters when loading the state dict.

Hi, could you tell me how you solved the problem? thx 😊

I'm also having this problem, can you please tell me if I should just use git clone https://github.com/EricGuo5513/HumanML3D.git and then unzip the texts.zip? It looks like there's only 1 file inside the new_joints folder, and I'm a little confused about how I should use it humanml3d pipeline.

WILLOSCAR avatar Apr 15 '24 01:04 WILLOSCAR

@Yawningx I asked the authors of HumanML3D for the zipped dataset and then unzipped texts.zip.

For me it worked, while for the second problem there is row 77 inmGPT.data.HumanML3D.HumanML3DDataModule that changes incorrectly the cfg.DATASET.NFEATURES, so I just hard-coded it to 263.

Could you please provide me with details on what the complete dataset catalog should include? Additionally, I would like to know the amount of data contained in the "new_joints" folder. If you still have a copy of the compressed dataset, I would greatly appreciate it if you could share it with me. Thank you!

WILLOSCAR avatar Apr 15 '24 01:04 WILLOSCAR

@Yawningx I asked the authors of HumanML3D for the zipped dataset and then unzipped texts.zip. For me it worked, while for the second problem there is row 77 inmGPT.data.HumanML3D.HumanML3DDataModule that changes incorrectly the cfg.DATASET.NFEATURES, so I just hard-coded it to 263.

Could you please provide me with details on what the complete dataset catalog should include? Additionally, I would like to know the amount of data contained in the "new_joints" folder. If you still have a copy of the compressed dataset, I would greatly appreciate it if you could share it with me. Thank you!

Hi! Just follow https://github.com/EricGuo5513/HumanML3D, process the data as it said.

Yawningx avatar Apr 19 '24 09:04 Yawningx

who can provide a right way

lwh-me avatar Mar 02 '25 14:03 lwh-me

who can provide a right way

I met the same problem today. With the help of the comments below this issue, it was solved through the following steps:

  1. Download dataset from https://github.com/EricGuo5513/HumanML3D. KIT-ML dataset is enough for this project.
  2. Make folder datasets under the main folder and extract the zip file in the dataset. Named the folder humanml3d.
  3. Unrar texts.rar, new_joints.rar and new_joint_vecs.rar in the datasets/humanml3d.
  4. cp -r prepare/instructions datasets/HumanML3D (I don't know whether it works. Just do it.)

After finishing all steps, run python demo.py --cfg ./configs/config_h3d_stage3.yaml --example ./demos/t2m.txt. ValueError was solved and there are other errors displayed.

I hope my experience will help you.

Image

Maxin-C avatar Mar 17 '25 10:03 Maxin-C

who can provide a right way

I met the same problem today. With the help of the comments below this issue, it was solved through the following steps:

  1. Download dataset from https://github.com/EricGuo5513/HumanML3D. KIT-ML dataset is enough for this project.
  2. Make folder datasets under the main folder and extract the zip file in the dataset. Named the folder humanml3d.
  3. Unrar texts.rar, new_joints.rar and new_joint_vecs.rar in the datasets/humanml3d.
  4. cp -r prepare/instructions datasets/HumanML3D (I don't know whether it works. Just do it.)

After finishing all steps, run python demo.py --cfg ./configs/config_h3d_stage3.yaml --example ./demos/t2m.txt. ValueError was solved and there are other errors displayed.

I hope my experience will help you.

Image

After performing the above steps, the bug I encountered is:

RuntimeError: Error(s) in loading state_dict for MovementConvEncoder:
size mismatch for main.0.weight: copying a param with shape torch.Size([512, 259, 4]) from checkpoint, the shape in current model is torch.Size([512, 247, 4]).

This bug is also mentioned in #62. By referring to the experience in #62, I realized that the suggestion I provided here was incorrect. This project requires the use of the AMASS version of the dataset, not the KIT-ML dataset.

Therefore, in the dataset import section of the above steps, you should not directly download the KIT-ML version of the dataset. Instead, you need to refer to the instructions in HumanML3D to locally build the AMASS version of the dataset. The other steps remain the same, otherwise, you will encounter the issues mentioned in #62. If you can read Chinese blogs, you can also refer to https://blog.csdn.net/qq_53930200/article/details/137646272?spm=1001.2014.3001.5501 (I implemented it by following this blog).

Currently, my code runs successfully, and I hope my advice can help you.

Tips: It's worth noting that there are some minor bugs in the raw_pose_processing.ipynb file of HumanML3D, but they are not difficult to fix. Don't just click run and leave it unattended.

Maxin-C avatar Mar 18 '25 07:03 Maxin-C