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

Hard-coded parameters in evaluate.py leads to errors #6

Closed
xwjabc opened this issue Jul 25, 2018 · 1 comment
Closed

Hard-coded parameters in evaluate.py leads to errors #6

xwjabc opened this issue Jul 25, 2018 · 1 comment

Comments

@xwjabc
Copy link

xwjabc commented Jul 25, 2018

In evaluate.py:

dloader_test = FewShotDataloader(
     dataset=MiniImageNet(phase=test_split),
     nKnovel=5, # number of novel categories on each training episode.
     nKbase=64, # number of base categories.
     nExemplars=nExemplars, # num training examples per novel category
     nTestNovel=15 * 5, # num test examples for all the novel categories
     nTestBase=15 * 5, # num test examples for all the base categories
     batch_size=1,
     num_workers=0,
     epoch_size=epoch_size, # num of batches per epoch
)

When evaluating the Proto Nets/Matching Nets, the hard-coded parameters above leads to some error related to missing Kbase_ids in FewShot.py because nKbase is set as non-zero (64). A possible fix is:

data_test_opt  = config['data_test_opt']
dloader_test = FewShotDataloader(
    dataset=MiniImageNet(phase=test_split),
    nKnovel=data_test_opt['nKnovel'], # number of novel categories on each training episode.
    nKbase=data_test_opt['nKbase'], # number of base categories.
    nExemplars=data_test_opt['nExemplars'], # num training examples per novel category
    nTestNovel=data_test_opt['nTestNovel'], # num test examples for all the novel categories
    nTestBase=data_test_opt['nTestBase'], # num test examples for all the base categories
    batch_size=data_test_opt['batch_size'],
    num_workers=args_opt.num_workers, #0
    epoch_size=epoch_size # num of batches per epoch # data_test_opt['epoch_size']
)
@gidariss
Copy link
Owner

Hi, thanks for letting me know. I just fixed according to your recommendation.

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

2 participants