amazon-science / patchcore-inspection

Apache License 2.0
691 stars 142 forks source link

IndexError: list index out of range #79

Closed William9Baker closed 1 year ago

William9Baker commented 1 year ago

I encountered this error while "Training models(2/13)" at " ref_num_patches = patch_shapes[0]" in "patchcore.py".

INFO:__main__:Evaluating dataset [mvtec_cable] (1/1)... INFO:__main__:Utilizing PatchCore Ensemble (N=13). INFO:__main__:Training models (1/13) Subsampling...: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 512/512 [00:00<00:00, 3744.12it/s] INFO:__main__:Training models (2/13) Traceback (most recent call last): File "/home/patchcore/run_patchcore.py", line 635, in <module> main() File "/home/patchcore/run_patchcore.py", line 57, in main run(methods = None, File "/home/patchcore/run_patchcore.py", line 167, in run PatchCore.fit(dataloaders["training"]) File "/home/patchcore/patchcore/patchcore.py", line 156, in fit self._fill_memory_bank(training_data) File "/home/patchcore/patchcore/patchcore.py", line 174, in _fill_memory_bank features.append(_image_to_features(image)) File "/home/patchcore/patchcore/patchcore.py", line 165, in _image_to_features return self._embed(input_image) File "/home/patchcore/patchcore/patchcore.py", line 113, in _embed ref_num_patches = patch_shapes[0] IndexError: list index out of range

MasakaSance commented 1 day ago

I also encountered this issue when using ViT. May I ask how did you solve it? @William9Baker