Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 4
    It's good that you pointed out how a network can be run directly since when starting with Pytorch Lightning without ever having used Pytorch directly hides the underlying mechanisms. I would argue that it's still reasonable in situations to use the Trainer class even for prediction, as it handles putting your model and data onto the GPU, it can call certain hooks, why reinvent the wheel? It's not an antipattern, rename the class to Commander and much of your argument is invalid. I still think it's good you pointed it out, but antipattern is too strong. Commented Jan 21, 2022 at 14:18
  • I think advice on how to get predictions from the model needs to include how to run it on a gpu, model.eval(), turning off gradients and all the other things that Lightning has done for the user so far. Simply calling model(x) is unlikely to do what the user wants. Commented Apr 7, 2022 at 20:04