How To Install PyTorch in Visual Studio Code (Windows 11)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone in this video we're going to be talking about how to install pytorch in Visual Studio code on Windows 11. if you do not have Visual Studio code installed yet on your PC click the video in the top right hand corner of your screen now or in the description down below to quickly install Visual Studio code on Windows 11. so let's just get right into this tutorial let's begin by opening up visual studio code by heading to our search bar and right-clicking it and running it as an admin so as to avoid any future permission errors now let's go to our desktop and create a brand new folder that we can use for our pie torch project so I'm just going to call it Pi torch project now we need a python file to import pytorch into right let's create a new folder through this button here and name it main.pi the dot Pi indicates that we are creating a python file now let's go up to view and open our terminal window as you can see we are indeed inside our newly created folder on our desktop based on this directory here so in order to import libraries inside our folder we should first create a python virtual environment to accomplish this let's head down to our terminal and type python 3.10 or whatever version of python you are working with Dash m v e n v study session however you can replace study session with whatever you wish to call your virtual environment though now if we go back to our File Explorer on Visual Studio code you can see our virtual environment is now here also make sure that you are using the correct interpreter after creating a virtual environment like so let's first activate our virtual environment so that our terminal knows we only want to work within this environment we need to find and use this activate file here through our terminal that was created with our virtual environment so to get there from our pytorch folder we enter study session scripts and then activate and be sure you are using forward slashes when moving between folders now you can see we're working within our virtual environment based on the parenthesis names here on the left of our terminal line to upgrade pip let's type pip3 install dash dash upgrade pip and we will install the latest version of pip now to install pytorch to our virtual environment let's type pip install torch and you should see a download begin like so to validate the pi torch is now installed correctly let's write the following simple code that will print out the version of pytorch that we just downloaded and this will prove that our library is downloaded correctly and actually usable thank you for checking out this video and I hope it helped your understanding of how to install pytorch in Visual Studio code on Windows 11. if you enjoyed please like subscribe and consider checking out our YouTube memberships by clicking that join button down below however if you have any comments questions or concerns about the information I provided in this video please leave a comment down below and I'll do my best to address your concerns
Info
Channel: StudySession
Views: 26,192
Rating: undefined out of 5
Keywords:
Id: aJggnCVeacs
Channel Id: undefined
Length: 3min 15sec (195 seconds)
Published: Mon Sep 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.