Skip to content

[Problem] track_emissions decorator returns a None #182

Description

@julien-boulay
  • CodeCarbon version: 1.2.0
  • Python version: 3.7
  • Operating System: MacOS

Description

Hi,
I encountered a problem with the track_emissions decorator.
While trying to wrap the training function of my model, which has the particularity to return a result (an element of a "Model" class needed for my use case), I realized that the track_emissions decorator was forcing a None return.

The problem (if it is one) seems to come from the track_emissions function :

def track_emissions(

line 478 and line 489

fn(*args, **kwargs)

fn(*args, **kwargs)

store the return of fn :

return_fn = fn(*args, **kwargs)

and then add

return return_fn
in

def wrapped_fn(*args, **kwargs):

Thank you !
Julien

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions