Ignite: Avoid moving model to device in create_supervised*

Created on 8 Apr 2020  路  4Comments  路  Source: pytorch/ignite

馃殌 Feature

As discussed here and previous messages, according to pytorch docs on model and optimizer. User should not move model to another device after constructing an optimizer for the model:

We need to handle this in the code:

  • remove the code that moves the model to device.
  • update the docstring and add a warning note on changed behaviour, cite pytorch docs.
  • update all basic examples : mnist etc who currently use unwanted behaviour.

cc @kai-tub

enhancement

Most helpful comment

Hi, I would like to work on this and complete the work I've started. :)
When this issue is closed I will come back to my tiny_benchmark_wrapper.

All 4 comments

Hi, I would like to work on this and complete the work I've started. :)
When this issue is closed I will come back to my tiny_benchmark_wrapper.

@kai-tub sounds good, thanks !

One quick question, what do you mean by:

... add a warning note on changed behavior

Is a normal Note: environment in the docstrings sufficient? Or do you mean warning from import warnings?

Good question, I mean this

.. warning::

     Be careful

which is rendered as here: https://pytorch.org/ignite/metrics.html#ignite.metrics.EpochMetric

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alykhantejani picture alykhantejani  路  3Comments

vfdev-5 picture vfdev-5  路  3Comments

jphdotam picture jphdotam  路  4Comments

samarth-robo picture samarth-robo  路  3Comments

Aiden-Jeon picture Aiden-Jeon  路  3Comments