SPEC icon indicating copy to clipboard operation
SPEC copied to clipboard

Error during single dataset evaluation

Open umariqb opened this issue 3 years ago • 1 comments

I tried running the evaluation only for the 3DPW dataset with the following command:

python scripts/spec_eval.py --cfg data/spec/checkpoints/spec_config.yaml --opts DATASET.VAL_DS 3dpw-test-cam 

But it gives the following error:

TypeError: test_step() missing 1 required positional argument: 'dataloader_nb'

Fixed it by giving a default value for dataloader_nb for the test_step function in trainer.py:

def test_step(self, batch, batch_nb, dataloader_nb=0):
    return self.validation_step(batch, batch_nb, dataloader_nb)

The error occurs because we don't append dataloader_idx to args in evaluation_loop.py:

if multiple_test_loaders or multiple_val_loaders:
    args.append(dataloader_idx)

umariqb avatar Oct 22 '21 00:10 umariqb

After fixing dataloader_nb=0, I got another error in spec/trainer.py https://github.com/mkocabas/SPEC/blob/d2fe2c264c72c98a5f479fc36f74bdd5f45427da/spec/trainer.py#L524 AttributeError: 'dict' object has no attribute 'append'

I added an input argument ds_name=self.val_ds[0].dataset to prevent the error.

uyoung-jeong avatar Feb 24 '22 05:02 uyoung-jeong