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

关于train.py中的的Dataset问题 #30

Open
zhibeiyou135 opened this issue Mar 18, 2024 · 2 comments
Open

关于train.py中的的Dataset问题 #30

zhibeiyou135 opened this issue Mar 18, 2024 · 2 comments

Comments

@zhibeiyou135
Copy link

在train.py中:
if args.dataset == 'mvtec':
train_data = MVTecDataset(root=args.train_data_path, transform=preprocess, target_transform=transform,
aug_rate=args.aug_rate)
并未设置mode='train',而 MVTecDataset中mode的默认值为 'test' 。下述代码:
if mode == 'train':
# 如果模式是 'train'
self.cls_names = [obj_name] # 将对象名称添加到类别名称列表
save_dir = os.path.join(save_dir, 'k_shot.txt') # 构建保存目录的路径
else:
self.cls_names = list(meta_info.keys()) # 否则,获取所有类别名称
无论是test.py还是train.py都不会执行 mode == 'train'。请问是应该将mode默认值设置为train,还是我理解的幼体,在train.py中mode就应该为test?

@ByChelsea
Copy link
Owner

ByChelsea commented Mar 18, 2024

Hi, in the zero-shot setting, we use the test set of another dataset for training (this conforms to the principle that zero-shot learning cannot train on data of related objects). More details please refer to our technical report.

The train mode in dataset.py is written for the few-shot setting.

@siri-ius
Copy link

Hi,

I have four following questions based on your answer:

> The train mode in dataset.py is written for the few-shot setting.

  1. Does it mean that when we train VAND model using the command 'bash train.sh', it is being trained only as a few-shot learning model?
  2. If yes, and then we store checkpoints for VisA and MVTec-AD datasets in exps/visa/new_checkpoints/epoch_15.pth and exps/mvtec/new_checkpoints/epoch_3.pth. Should we use these checkpoints to evaluate the perfomance of VAND on mvtec and visa datasets as in ZSAD (bash test_zero_shot.sh) or FSAD (bash test_few_shot.sh) ?
  3. If answer to Q1 is yes, then could you please guide us on how can we train VAND as a zero-shot learning model?
  4. If answer to Q2 is FSAD, then could you please guide us on how can we evaluate VAND as a zero-shot learning model?

Thanks a lot!
Looking forward to hearing from you!

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

3 participants