Git Product home page Git Product logo

fewshot_ensemble's People

Contributors

dvornikita avatar tsingularity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fewshot_ensemble's Issues

Error in normalization of losses

Hey, thanks for the nice work.
Just reading your code, and I think there is a mistake in normalizing logits without the true label.
probs /= (all_probs.sum(dim=1, keepdim=True) + 1e-8)
should rather be
probs /= (probs.sum(dim=1, keepdim=True) + 1e-8)
in relation_loss in the ensembles.py file

And then similarly, for example for cos reg_type,
probs = probs / torch.sqrt(((all_probs ** 2).sum(dim=1, keepdim=True) + 1e-8)) # l2 normed
should be
probs = probs / torch.sqrt(((probs ** 2).sum(dim=1, keepdim=True) + 1e-8)) # l2 normed
as far as I understood your paper

ValueError: Sample larger than population

Getting this error from meta_dataset.py file

chosen_class_inds = random.sample(
                all_class_inds, self.n_train + self.n_test)

I am training a single model on cub dataset. Do you know what might be causing this?

Values of self.n_train -> 15, self.n_test -> 5, len(all_class_inds) -> 30

ValueError: empty range for randrange() (0,-139, -139)

python ensembles/train.py --model.model_name=deep_robust10 --data.dataset=mini_imagenet --model.backbone=deep --ens.num_heads=10 --ens.relation_type=robust

!!!!!! Starting ephoch 0 !!!!!!
0%| | 0/2400 [00:00<?, ?it/s]Traceback (most recent call last):
File "/xinfu/code/few_shot_learning/fewshot_ensemble/ensembles/train.py", line 178, in
main()
File "/xinfu/code/few_shot_learning/fewshot_ensemble/ensembles/train.py", line 62, in main
for i, sample in enumerate(tqdm(train_sampler)):
File "/opt/conda/lib/python3.6/site-packages/tqdm/_tqdm.py", line 931, in iter
for obj in iterable:
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 339, in next
return self._process_next_batch(batch)
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 360, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 113, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 113, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/xinfu/code/few_shot_learning/fewshot_ensemble/data/datasets.py", line 60, in getitem
img = self.transform(img)
File "/opt/conda/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 49, in call
img = t(img)
File "/opt/conda/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 421, in call
i, j, h, w = self.get_params(img, self.size)
File "/opt/conda/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 399, in get_params
i = random.randint(0, h - th)
File "/opt/conda/lib/python3.6/random.py", line 221, in randint
return self.randrange(a, b+1)
File "/opt/conda/lib/python3.6/random.py", line 199, in randrange
raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,-139, -139)

The error occurrs while running the program. Would you please tell me the reason?

RAM usage increasing continuously as training progress

My CPU RAM (not GPU) usage is increasing continuously as training progresses. When training on mini-imagenet it starts from 5 gb and continues to increase beyond 16 gb which is the max. RAM that I have hence system crashes.

Is this the expected behavior (increased RAM utilization after every iteration?). If so, how can I fix the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.