prannaykaul / lvc

Official repo for our CVPR 22 paper: "Label, Verify, Correct: A Simple Few-Shot Object Detection Method"
Apache License 2.0
88 stars 14 forks source link

TRAIN_FULL.md Part 3, Step 3 #12

Closed takbess closed 2 years ago

takbess commented 2 years ago

Following the instructions, I tried the command:

python -m tools.run_nearest_neighbours \
    --config-file configs/LABEL-Verification/dino_label_verification.yaml \
    --num-gpus 2 \
    --eval-only \
    --opts \
    DATASETS.DT_PATH "('checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout/inference/coco_instances_trainval_results_score_max10_min08_full_all.json',)" \
    DATASETS.NN_DSET "('coco_trainval_all_30shot',)" \
    QUERY_EXPAND.KNN 10 \
    OUTPUT_DIR "checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout"

The difference from the original command of Part 3, Step 3 in TRAIN_FULL.md is "--num-gpus 2". Then, I got the error:

ValueError: Type mismatch (<class 'list'> vs. <class 'str'>) with values ([] vs. ('checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout/inference/coco_instances_trainval_results_score_max10_min08_full_all.json')

So, I modified the following three points. (1) I modified the command as:

python -m tools.run_nearest_neighbours \
    --config-file configs/LABEL-Verification/dino_label_verification.yaml \
    --num-gpus 2 \
    --eval-only \
    --opts \
    DATASETS.DT_PATH "('checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout/inference/coco_instances_trainval_results_score_max10_min08_full_all.json',)" \
    QUERY_EXPAND.NN_DSET "('coco_trainval_all_30shot',)" \
    QUERY_EXPAND.KNN 10 \
    OUTPUT_DIR "checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout"

The difference is "DATASETS.NN_DSET" -> "QUERY_EXPAND.NN_DSET".

(2) I modified configs/LABEL-Verification/dino_label_verification.yaml as

DT_PATH: ('checkpoints/coco/faster_rcnn/faster_rcnn_R_50_FPN_ft_all_30shot_aug_ftmore_dropout/inference/coco_instances_trainval_results_score_max10_min08_full_all.json',)

Here, I added the comma and the closing parenthesis ",)".

(3) I modified lvc/config/defaults.py as

_CC.DATASETS.DT_PATH = ()

Here, I changed "[]" -> "()".

Are these modifications correct?

prannaykaul commented 2 years ago

Yes this is correct. I will update the scripts.