Giter VIP home page Giter VIP logo

cumix's People

Contributors

mancinimassimiliano 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cumix's Issues

Question about the mixup operation in this code

Hello, I think there exsists a logical error in your code.

In methods.py, the class method get_sample_mixup() of the class CuMix is not consistant with the mixup rules your proposed in paper.

Here I take out the error line 246

indeces = ratio_within_dom * permuted_within_dom + (1. - ratio_within_dom) * permuted_across_dom

In your code, you mixup the index instead of content (image or feature) or label, then the mixup index are employed to extract content from current batch.

This is not reasonable and not consistant with Eq. (5) in your paper.

Hope you can check the code. Thanks

mixup_labels

Hi! Why do synthesized labels(mixup_labels) have decimals?
I wanted to use it as a data enhancement to add to the method, but found that mixup_labels is not an integer.

When I put training set labels and mixup_labels cat after cross entropy float type error
How do I turn mixup_labels into integers?

thanks!
image

The needed compute resources to train on ZSL+DG

Hi @mancinimassimiliano,

I'm trying to reproduce your results on ZSL+DG. When I trained the model on one RTX 2080Ti even one Titan V100, it ran out of memory. Could you please tell more about the compute for your ZSL+DG experiments? It would be great if you can give an estimated training time.

Thanks so much.

Herewidth I've attached the error info:

configs/zsl+dg/painting.json

Target: painting run 1/10
Traceback (most recent call last):
File "main.py", line 143, in
method = CuMix(seen_classes=seen,unseen_classes=unseen,attributes=attributes,configs=configs,zsl_only = not args.dg,
File "/ibex/scratch/yik/CIZSL-JournalVersion/CuMix/methods.py", line 83, in init
self.backbone.to(device)
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/nn/modules/module.py", line 443, in to
return self._apply(convert)
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/nn/modules/module.py", line 203, in _apply
module._apply(fn)
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/nn/modules/module.py", line 225, in _apply
param_applied = fn(param)
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/nn/modules/module.py", line 441, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: out of memory
Traceback (most recent call last):
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/distributed/launch.py", line 263, in
main()
File "/home/yik/anaconda2/envs/cumix/lib/python3.8/site-packages/torch/distributed/launch.py", line 258, in main
raise subprocess.CalledProcessError(returncode=process.returncode,
subprocess.CalledProcessError: Command '['/home/yik/anaconda2/envs/cumix/bin/python', '-u', 'main.py', '--local_rank=0', '--zsl', '--dg', '--target', 'painting', '--config_file', 'configs/zsl+dg/painting.json', '--data_root', '/xxx/CuMix/data/DomainNet', '--name', 'painting_exps_zsldg']' returned non-zero exit status 1.

Domain Permutation in methods.py

Hi @mancinimassimiliano,

Below is the get_sample_mixup function on L237 in methods.py:

def get_sample_mixup(self, domains):
        # Check how many domains are in each batch (if 1 skip, but we have 1 just in ZSL only exps)
        if self.dpb>1:
            doms = list(range(len(torch.unique(domains))))
            bs = domains.size(0) // len(doms)
            selected = derange(doms)
            permuted_across_dom = torch.cat([(torch.randperm(bs) + selected[i] * bs) for i in range(len(doms))])
            permuted_within_dom = torch.cat([(torch.randperm(bs) + i * bs) for i in range(len(doms))])
            ratio_within_dom = torch.from_numpy(RG.binomial(1, self.mixup_domain, size=domains.size(0)))
            indeces = ratio_within_dom * permuted_within_dom + (1. - ratio_within_dom) * permuted_across_dom
        else:
            indeces = torch.randperm(domains.size(0))
        return indeces.long()

As I understand for domains per batch > 1, depending on ratio_within_dom (1 or 0) this function returns indices for mixup either within or across domains. However, I can't understand how the 2 tensors permuted_across_dom and permuted_within_dom ensure that the batch indices are properly re-arranged to achieve this. I have tried with some dummy inputs, but couldn't figure out the exact logic. Would like to hear your thoughts on this.

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.