Skip to content

Vision Transformer Models Cause IndexError in PatchCore #63

@1amrutesh

Description

@1amrutesh

I encountered an issue when trying to use Vision Transformer based models like vit_base, vit_swin_large, etc. in the PatchCore implementation. I tried to execute this on the Kaggle Notebook environment. I get an IndexError: list index out of range when running the provided script, as shown below:
Traceback (most recent call last): File "/kaggle/input/patchcore/patchcore-inspection-main/bin/run_patchcore.py", line 435, in <module> main() ... File "/kaggle/input/patchcore/patchcore-inspection-main/src/patchcore/patchcore.py", line 110, in _embed ref_num_patches = patch_shapes[0] IndexError: list index out of range
Here's the command I used to run the script:

!python /kaggle/input/patchcore/patchcore-inspection-main/bin/run_patchcore.py --gpu 0 --seed 0 --save_patchcore_model \ --log_group IM224_WR50_L2-3_P01_D1024-1024_PS-3_AN-1_S0 --log_project MVTecAD_Results results \ patch_core -b vit_small --faiss_on_gpu \ --pretrain_embed_dimension 1024 --target_embed_dimension 1024 --anomaly_scorer_num_nn 1 --patchsize 3 \ sampler -p 0.1 approx_greedy_coreset dataset --resize 224 --imagesize 224 {dataset_flags} mvtec $datapath
I followed the guidelines provided in the GitHub repository but still encountered this error. I would appreciate any help in resolving this issue.

Please let me know if any additional information is required to better understand and diagnose the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions