Install the Extension
Launch TorchStudio, and click > Settings…
In the IDE Extensions section, install the extension for your IDE.
The following IDEs are supported:
- Visual Studio Code 1.62 or higher
- PyCharm 2020 or higher
- Spyder 5.3.3 or higher
- Sublime Text 4 or higher
Once the extension installed, you can close TorchStudio and launch your IDE.
Add TorchStudio to your IDE project
Right-click on your project folder then click on New TorchStudio Training
(Spyder: click Open IPython console here and type !torchstudio new
)
This will add a TorchStudio Training.tsz file to your project.
Drag your scripts to TorchStudio
To open TorchStudio within your IDE, click on TorchStudio Training.tsz
(Pycharm and Spyder: double-click).
TorchStudio window will appear on top of your IDE (notice the active pin icon in TorchStudio’s title bar which maintain the window on top).
Then drag your dataset script from your IDE to TorchStudio (Sublime Text: right-click > Send to TorchStudio). You can alternatively use a dataset provided by TorchStudio.
Click Load in TorchStudio to load it. This allows your to explore the dataset, reformat it and analyze it if needed.
Then create a model tab by clicking on the button at the top, and drag your model script from your IDE to TorchStudio (Sublime Text: right-click > Send to TorchStudio). You can alternatively use a model provided by TorchStudio.
Click Build in TorchStudio. This will show you its graph, and allows you to define hyperparameters and a device for the training.
Then click Train to train it.
Export the weights back to your IDE
Once you’ve trained your model, you can export its weights back to your IDE by clicking > Export Model… (or press Ctrl+E).
You can then close TorchStudio.