Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: index 2743 is out of bounds for axis 0 with size 100 ??how to deal with this ? #15

Open
dw1360585641 opened this issue Sep 30, 2024 · 1 comment

Comments

@dw1360585641
Copy link

Building transform_test

  • resize the smaller edge to 224
  • 224x224 center crop
  • to torch tensor of range [0, 1]
  • normalization (mean=[0.48145466, 0.4578275, 0.40821073], std=[0.26862954, 0.26130258, 0.27577711])
    Building transform_train
  • random resized crop (size=(224, 224), scale=(0.08, 1.0))
  • random flip
  • to torch tensor of range [0, 1]
  • normalization (mean=[0.48145466, 0.4578275, 0.40821073], std=[0.26862954, 0.26130258, 0.27577711])
    Loading CLIP (backbone: RN50)
    Building custom CLIP
    Initializing a generic context
    Initial context: "X X X X X X X X X X X X X X X X"
    Number of context words (tokens): 16
    Turning off gradients in both the image and the text encoder
    Loading evaluator: UPLClassification
    Traceback (most recent call last):
    File "upl_train.py", line 225, in
    main(args)
    File "upl_train.py", line 143, in main
    model_names=cfg.MODEL.PSEUDO_LABEL_MODELS)
    File "/data/kb/wdw/upl/trainers/upltrainer.py", line 578, in load_from_exist_file
    predict_label_dict, predict_conf_dict = select_top_k_similarity_per_class(logits, sstrain_img_paths, K=self.cfg.DATASET.NUM_SHOTS, is_softmax=False)
    File "/data/kb/wdw/upl/trainers/utils.py", line 99, in select_top_k_similarity_per_class
    img_paths = img_paths[output_m_max_id]
    IndexError: index 2743 is out of bounds for axis 0 with size 100
    !!!!!!!when I followed your instructions to train CUDA_VISIBLEDEVICES=0 bash up_train.sh sscaltech101 rn50_ ep50 end 16 16 False True rn50_random_init, and encountered this problem. How can I solve it?
@dw1360585641
Copy link
Author

@tonyhuang2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant