h-y1heng / StableMoFusion

MIT License
49 stars 5 forks source link

Trouble in "Train your own vGRF model for footskate cleanup" #4

Closed fyyakaxyy closed 1 month ago

fyyakaxyy commented 1 month ago

hello, when I run:

python -m utils.scripts.train_UnderPressure_model --dataset_name t2m

the problem is:

Traceback (most recent call last):
  File "stablemofusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "stablemofusion/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "StableMoFusion/utils/scripts/train_UnderPressure_model.py", line 93, in <module>
    skeleton = Skeletons.all()[0].to(device)
  File "StableMoFusion/UnderPressure/skeletons.py", line 17, in all
    files = [next(s.preprocessed_files()) for s in Subject.all()]
  File "StableMoFusion/UnderPressure/skeletons.py", line 17, in <listcomp>
    files = [next(s.preprocessed_files()) for s in Subject.all()]
TypeError: 'list' object is not an iterator

I change code in UnderPressure/skeletons.py:

class Skeletons:
    @classmethod
    def all(cls):
        files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
        return torch.cat([torch.load(file)["skeleton"] for file in files])

    @classmethod
    def train(cls):
        files = [next(iter(s.preprocessed_files())) for s in Subject.train()]
        return torch.cat([torch.load(file)["skeleton"] for file in files])

    @classmethod
    def test(cls):
        files = [next(iter(s.preprocessed_files())) for s in Subject.test()]
        return torch.cat([torch.load(file)["skeleton"] for file in files])

the problem is:

File "stablemofusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "stablemofusion/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "StableMoFusion/utils/scripts/train_UnderPressure_model.py", line 93, in <module>
    skeleton = Skeletons.all()[0].to(device)
  File "StableMoFusion/UnderPressure/skeletons.py", line 33, in all
    files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
  File "StableMoFusion/UnderPressure/skeletons.py", line 33, in <listcomp>
    files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
StopIteration

it seems that "files" is empty, how to fix it?

h-y1heng commented 1 month ago

hello, when I run:

python -m utils.scripts.train_UnderPressure_model --dataset_name t2m

the problem is:

Traceback (most recent call last):
  File "stablemofusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "stablemofusion/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "StableMoFusion/utils/scripts/train_UnderPressure_model.py", line 93, in <module>
    skeleton = Skeletons.all()[0].to(device)
  File "StableMoFusion/UnderPressure/skeletons.py", line 17, in all
    files = [next(s.preprocessed_files()) for s in Subject.all()]
  File "StableMoFusion/UnderPressure/skeletons.py", line 17, in <listcomp>
    files = [next(s.preprocessed_files()) for s in Subject.all()]
TypeError: 'list' object is not an iterator

I change code in UnderPressure/skeletons.py:

class Skeletons:
  @classmethod
  def all(cls):
      files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
      return torch.cat([torch.load(file)["skeleton"] for file in files])

  @classmethod
  def train(cls):
      files = [next(iter(s.preprocessed_files())) for s in Subject.train()]
      return torch.cat([torch.load(file)["skeleton"] for file in files])

  @classmethod
  def test(cls):
      files = [next(iter(s.preprocessed_files())) for s in Subject.test()]
      return torch.cat([torch.load(file)["skeleton"] for file in files])

the problem is:

File "stablemofusion/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "stablemofusion/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "StableMoFusion/utils/scripts/train_UnderPressure_model.py", line 93, in <module>
    skeleton = Skeletons.all()[0].to(device)
  File "StableMoFusion/UnderPressure/skeletons.py", line 33, in all
    files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
  File "StableMoFusion/UnderPressure/skeletons.py", line 33, in <listcomp>
    files = [next(iter(s.preprocessed_files())) for s in Subject.all()]
StopIteration

it seems that "files" is empty, how to fix it?

I am sorry for this issue. We've noticed that many people are experiencing this issue because the dataset in the UnderPressure are incomplete, which is needed in our original code to obtain their skeleton data. To make this issue easier, we've updated the code scripts/train_UnderPressure_model.py and utils/footskate_clean.py, and provided a processed UnderPressure skeleton data in ./UnderPressure/dataset/S1_HoppingLeftFootRightFoot.pth. In this way, you can run our scripts without loading and process the dataset in UnderPressure.