PeterL1n / BackgroundMattingV2

Real-Time High-Resolution Background Matting
MIT License
6.81k stars 950 forks source link

AssertionError: Datasets are not equal in length. #47

Closed NaeemKhan333 closed 3 years ago

NaeemKhan333 commented 3 years ago

Thanks for nice work.I am running the file 'inference_images.py'

python inference_images.py --model-type=mattingrefine --model-backbone=resnet50 --model-backbone-scale 0.25 --model-refine-mode sampling --model-refine-sample-pixels 80000 --model-checkpoint=pytorch_resnet50.pth --images-src=myimages/ --images-bgr=back/ --device=cpu --output-dir=out/ --output-types=com

I am getting the following error

Traceback (most recent call last):
  File "inference_images.py", line 108, in <module>
    A.PairApply(T.ToTensor())
  File "/home/mylaptop/Downloads/BackgroundMattingV2/dataset/zip.py", line 11, in __init__
    assert len(datasets[i]) == len(datasets[i - 1]), 'Datasets are not equal in length.'
AssertionError: Datasets are not equal in length.
PeterL1n commented 3 years ago

That tells you your myimages/ and back/ directories contain different numbers of images. They need to have the same amount of images to have a one-to-one correspondence.