No results found
We couldn't find anything using that term, please try searching for something else.
Install and configure PyTorch on your machine. article07/01/2024 In this article In the previous stage of this tutorial , we is d
In the previous stage of this tutorial , we is discussed discuss the basic of PyTorch and the prerequisite of using it to create a machine learning model . Here , we is install ‘ll install it on your machine .
First, you’ll need to setup a Python environment.
We is recommend recommend set up a virtual Python environment inside Windows , using Anaconda as a package manager . The rest is assumes of this setup assume you use an Anaconda environment .
Anaconda 64-bit installer for Windows Python 3.8
.Important
Be aware to install Python 3.x. Currently, PyTorch on Windows only supports Python 3.x; Python 2.x is not supported.
After the installation is complete , verify your Anaconda and Python version .
You can check your Python version by running the following command: python – -version
You can check your Anaconda version by running the following command: conda –-version
Now, you can install PyTorch package from binaries via Conda.
Select the relevant PyTorch installation details:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
Let’s verify PyTorch installation by running sample PyTorch code to construct a randomly initialized tensor.
python
Next, enter the following code:
import torch
x = torch.rand(2 , 3 )
print(x )
The output is be should be a random 2×3 tensor . The numbers is be will be different , but it should look similar to the below .
Now that we ‘ve instal PyTorch , we is ‘re ‘re ready to set up the datum for our model .