Can I find old docs (torch.utils.trainer.plugins)

username: Vincent_Brisse
cooked: <p>I’m trying to update some old code using pytorch 0.4, and it uses<code>torch.utils.trainer.plugins Logger</code>. It’s not supported by more recent versions of pytorch, and therefore I need to get rid of it. Is there any old docs showing what its purpose is and how can I replace it ?</p>

username: akernel
cooked: <p>Unfortunately it looks like <code>trainer</code> was an undocumented portion of PyTorch that has been removed (see <a href="https://discuss.pytorch.org/t/any-docs-for-torch-utils-trainer/2208">this forum post</a> and <a href="https://github.com/pytorch/pytorch/issues/1202#issuecomment-292217519" rel="nofollow noopener">this GitHub comment</a>).  The same forum post recommends <a href="https://github.com/pytorch/tnt" rel="nofollow noopener">TNT</a> and also points to an <a href="https://discuss.pytorch.org/t/supermodule-for-keras-like-training-with-callbacks-constraints-and-progress-bar/2075">older forum post</a>.</p>
<p>However, all of this is from 2017.  I’m not entirely sure what <code>Logger</code> did, but you could check out <a href="https://docs.fast.ai" rel="nofollow noopener"><code>fast.ai</code>'s codebase</a>, which allows for <a href="https://docs.fast.ai/metrics.html" rel="nofollow noopener"><code>metrics</code></a> and <a href="https://docs.fast.ai/callback.html" rel="nofollow noopener"><code>callbacks</code></a>.  I hope that helps a bit!</p>

username: Vincent_Brisse
cooked: <p>Thank you for your reply !<br>
Maybe you can help me out with the other ones as well ? They’re called Monitor, LossMonitor and there is also something about checkpoints. How are checkpoints handled on more recent versions of pytorch ?</p>

username: akernel
cooked: <p>Of course! So all of <code>torch.utils.trainer</code> was an undocumented and since-removed portion of PyTorch.  As such, <code>Monitor</code> and <code>LossMonitor</code> are in the same category as <code>Logger</code>, to the best of my knowledge.  A lot of people have worked on tools to monitor training in PyTorch:</p>
<ul>
<li>there are ways to <a href="https://pytorch.org/docs/stable/tensorboard.html" rel="nofollow noopener">hook up Tensorboard to PyTorch</a>
</li>
<li>or use <a href="https://github.com/lanpa/tensorboardX" rel="nofollow noopener">TensorboardX</a>
</li>
<li>the aforementioned <code>fast.ai</code> <code>metrics</code> and <code>callbacks</code> (which I only mention again because it is what I use, but not necessarily best)</li>
<li>a Facebook tool called <a href="https://github.com/facebookresearch/visdom" rel="nofollow noopener">Visdom</a>
</li>
<li>and even commercial products like <a href="https://www.wandb.com/" rel="nofollow noopener">Weights and Biases</a> (which seems pretty cool, I’ll have to check it out!)</li>
</ul>
<p>There are probably a ton more options out there, and it’ll depend on what your use case is, how in-depth you need to go, etc.</p>
<p>As for checkpointing, I’m not sure if you’re talking about <a href="https://pytorch.org/docs/stable/checkpoint.html" rel="nofollow noopener"><code>torch.utils.checkpoint</code></a>, a tool that has existed (and still exists!) in PyTorch to trade more computing time for less memory usage, or simply saving the model, which is commonly called checkpointing both in other systems (<a href="https://www.tensorflow.org/guide/checkpoints" rel="nofollow noopener">like Tensorflow</a>) and in codebases (like my own…).</p>
<p>If you’re talking about the former, I’ve never used it but a quick glance makes it look like checkpointing is mostly the same since 0.4.0.</p>
<p>If you’re talking about the latter, that is done via <a href="https://pytorch.org/docs/stable/torch.html?highlight=save#torch.save" rel="nofollow noopener"><code>torch.save</code></a>, which “checkpoints” your model by saving the model weights to a pickled file.</p>
<p>Hope that helps!</p>

username: Vincent_Brisse
cooked: <p>Thank you so much for the detailed answer ! This is going to be very useful, I’m pretty sure I was thinking of “checkpointing”. The code I have runs with torch 0.4.0, but it was created in an earlier version, and therefore I can only guess that they had to create their own checkpointing method. torch.save seems a lot less trouble !</p>
<p>Once again, thank you for being kind and helpful with a newcomer, it makes you want to stay with the community.</p>

username: akernel
cooked: <p>Glad I could help!  I’ve been using PyTorch for a while now but just recently got into the community, it’s a pretty welcoming place – glad I could pass it on!  Good luck with your version updating project, I must say I don’t envy you <img src="https://discuss.pytorch.org/images/emoji/apple/sweat_smile.png?v=9" title=":sweat_smile:" class="emoji" alt=":sweat_smile:"></p>