Giter Club home page Giter Club logo

mtadam's People

Contributors

itzikmalkiel 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

Watchers

 avatar

mtadam's Issues

AttributeError: 'Parameter' object has no attribute 'denom'

Hi,

thank you for this repo. I tried to use your optimizer, and I get the error:

Traceback (most recent call last):
  File "train.py", line 241, in <module>
    optimizer.step(loss_array, ranks, None)
  File "/home/fdiakogiannis/Software/torch/optim/optimizer.py", line 89, in wrapper
    return func(*args, **kwargs)
  File "/home/fdiakogiannis/Software/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/fdiakogiannis/Projects/OI-FD-dev/src/training_scripts/nbeatsxx/model_v3_quantile_to/mtadam.py", line 64, in step
    self.update_weights(loss_array, ranks)
  File "/home/fdiakogiannis/Projects/OI-FD-dev/src/training_scripts/nbeatsxx/model_v3_quantile_to/mtadam.py", line 153, in update_weights
    max_denom = p.denom[0]
AttributeError: 'Parameter' object has no attribute 'denom'
srun: error: hyades03: task 0: Exited with exit code 1

I tried to use MTAdam to combine L1Loss and BCELoss. The relative code entries I use are:

# Balanced Adam optimizer 
from mtadam import *

...
optimizer = MTAdam(net.parameters(), lr=0.001)
...
# The first loss is L1 the second BCE Loss, as given by torch.nn. 
loss_array = [criterion(ypreds, ylabel), criterion_pp(to_preds,to_label)]
ranks = [1]*len(loss_array)
optimizer.step(loss_array, ranks, None)

any ideas on how to overcome the problem? I am using the NGC NVIDIA container for pytorch.

Kind regards,
Foivos

cuda memory leak

Thanks for sharing, this is a simple and interesting way to use auxiliary losses.

When using it on a large dataset I get a memory leak, it uses up more and more cuda memory untill it crashes. I think this is because the graph is not cleared loss.backward(retain_graph=True).

The obvious next step is to clear the graph with a loss.backward(retain_graph=False) but I get an error that the variables have been modified. I assume this is an intentional or metabalance, but I can't find where, and I can't find a way to clear the graph manually.

Any tips?

Note I cross posted this to metabalance, probobly because it has the same issue, being based of MTAdam code.

facebookresearch/MetaBalance#2

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.