So in this lecture I'm going to explain how to set up your deep learning libraries to make use of the
GP you on your home laptop or desktop.
This video is a companion lecture to my blog post which you can find at lazy program and not me.
Now of course you don't have to memorize this your yourself or tried to type it out manually.
Instead you can just go to the top of the page where the navigation bar is and click the link that says
machine learning and data science.
Then you scroll down to the section called practical issues where you will find a link to this post.
There are a ton of useful links in this post so you'll probably want to follow along in your browser
as I walk you through it.
So I'll give you a minute to click on this link so that you're viewing this post in your browser and
then you can come back when you're ready.
So in my second deep learning course Deep Learning part two I originally discussed how to setup a GP
based instance on Amazon Web Services.
This is nice because you can choose a pre-built image which has everything already installed for you.
The only thing you need to do is copy your script to the machine and then run it.
However depending on your needs that might become expensive on Amazon Web Services you are billed by
the second.
So you might consider getting your own machine with a GP you to run your deep learning scripts.
The upside to this is that you pay a flat fee which is the computer itself.
The downside to this is that you have to install everything yourself.
So this lecture is all about how do you go through this entire process of choosing the right machine
and then once you have your machine.
How do you install everything.
So this is a lecture I've wanted to make for a long time but I've always put it off because it's not
a straightforward process and things are always changing and breaking.
So it was a matter of how do I write this lecture in such a way that it won't become out of date.
As usual you have to learn my rule.
Learn the principles and not the syntax.
The goal of this lecture is to learn the high level steps the details will always be in flux and there's
nothing you can do about that.
So I don't want you coming to me and saying you know hey I copied and pasted this line from your tutorial
but it didn't work.
My answer is going to be of course it's not.
I told you these things are always changing so you must be principles based and not syntax based if
you're just copying commands without thinking.
That's not the right approach.
The right approach is to complete each of the high level steps and if one method doesn't work then try
another and another and another until it does work.
So hopefully this lecture helps you understand these high level principles.
I'm also going to share with you a bunch of stories about how things might go wrong to demonstrate to
you that unexpected problems can and will happen.
It's just the nature of the game.
You might install something and you might follow those instructions perfectly and then your computer
just won't start.
That can happen.
So it's important for you to keep an open mind and realize that these things will happen and do not
get scared or intimidated when things go wrong.
Remember that I didn't invent any of these technologies.
I'm just passing along information so if something does go wrong.
Your best bet is to google your problem and see if anyone else has encountered it coming to me with
your problem.
Probably won't help you because I don't have the same computer as you and I'm probably going to be using
a different version of everything so let's start with the basics.
Why do you need this guy.
Well if you're a beginner you may have presume that all you need to do is just buy a laptop with a GP
you and all of a sudden your deep learning libraries will be cheaper you accelerate it.
This is incorrect.
There are two reasons this is incorrect.
First you need to have a specific kind of GP you kind of made by and a video.
Second you need to have special software that works with a GP you one of which is the GP you driver.
Now a lot of you younger folks these days probably have zero idea of what a driver is.
A driver is low level software that interacts with hardware in the old days.
Any device you plugged into your computer would require a driver.
For example if you wanted to plug in a printer you have to install a driver.
If you wanted to plug in an external USP hard drive or a USP webcam you would need to install drivers.
In other words a driver is software that allows your computer and external hardware to talk to each
other.
And that's exactly what we have here.
Your computer needs to talk to the GP you.
And it doesn't know how to do that automatically in fact there is an entire stack of software that you
need in order to leverage the GP you for deep learning.
The idea of the stack helps us organize high level things and low level things.
So the lowest level we have hardware that includes things like the GP you printers webcams and so forth.
On top of that as mentioned we have drivers which allow the computer to talk to the hardware.
In our case the driver is called Kuta after skipping a few steps.
We have the software that we use such as tensor flow pi torching cars.
In fact Caris is even higher level than tensor flow because it's built on top of tensor flow.
So generally speaking the high level you go the simpler your code is but you also have less flexibility.
Long story short buying just any laptop with any GP you will not work.
Instead you have to buy the right laptop with the right keep you.
And on top of that you have to install the right drivers and the right software.
In other words your entire staff has to be correct.
If you mess up any of these steps then it won't work so we're going to start at the lowest level the
hardware to keep things simple.
I'm going to assume that you'll be buying a laptop there are gaming firms out there.
If you're the type of person that wants to build your own P.C. from scratch however I'm going to assume
that you do not want to fiddle around with hardware because that's a completely different topic than
what we are discussing in this course it's important to note that GP use are not created equal.
You must buy a laptop with an end of video.
That means no HMV and no intel.
You'll notice that there are some laptops out there that come with mobile GP use and have an M in the
name for example the GTA X 950 M these are ok but the 900 M's tend to not have enough RAM and they're
not as fast.
Personally I wouldn't want to keep you with at least four gigs of ram.
The more RAM you have the larger your backside.
This can be
so to that end I'm going to recommend a few laptops.
Specifically I would recommend Lenovo or Dell with a slight preference for Lenovo.
The reason for this is that Lenovo machines usually work very well with Linux.
Now you might wonder why do I care about using Linux.
I'll discuss this more later in this lecture.
For now let's continue looking at these laptops.
So first we have a Lenovo idea pad.
It has a 15 inch screen eight gigs of ram 512 gig SSD energy ATX 16 50 for the GP you notably the price
is just under 700 dollars which is pretty good.
On the downside eight gigs of ram is on the lower end these days and the processor is only a high five.
You'll get much better performance on an AI seven.
Next we have what is essentially the same computer but with a different configuration.
So this one has 16 gigs of ram and an AI seven processor but only 256 gigs of SSD space which is personally
too small for my needs.
Importantly though it has the same GP you.
This is also a few hundred dollars more expensive than the first laptop.
So you're really paying for that Ram and the faster processor
next we have what I think is the best option out of the ones I've looked at which is on the Nova legion.
This one has an eye 7 processor 24 gigs of ram a one terabyte hard drive in a 512 gig SSD and it has
the same GP U as the other laptops.
We looked at on top of that.
It's nearly the same price as the previous laptop still under 1000 dollars.
Finally for contrast I've listed a Dell machine.
This one's got an eye seven processor 16 gigs of ram a one terabyte ssd and the same GP you as above.
Unfortunately the price of this machine is nearly double the Lenovo machine.
So you're really paying for that ultra high definition touchscreen.
Personally that's not something I care about.
So it's not something I would want to pay for.
Now you might be wondering if you watch my videos you'll notice that most of my videos are made on a
Mac.
Unfortunately these days Macs are no good for deep learning the Cuda drivers we're about to discuss
are no longer made from Macs so effectively and video is no longer supporting the Mac.
And if you recall I said everything in the stack has to work together.
So if you're trying to install the newest version of tensor flow it's not going to work with an older
version of cuda.
You might think Wow you're pretty good with these things so you'll just compile tensor flow from the
source code.
Well I spent a day on that before I gave up.
So that's something you might want to take into consideration.
OK.
So at this point you've chosen your laptop your laptop has arrived in the mail.
Awesome.
You have a new superfast super performing computer for deplaning.
Now you have an important decision to make.
What operating system should you use.
Most of these machines come with Windows 10 but you'll always hear me recommending Linux.
So why is that.
Should you replace Windows with Linux.
What are the tradeoffs at this point.
I want to remind you of my motto.
Learn the principles not the syntax.
So what are the important principles here.
Now again a lot of you probably haven't been around long enough to have experienced this first hand.
So you have to rely on my experience and my experience is that in general things aren't built for Windows
right off the bat.
If you're a Windows user you usually have to wait some time before you can use the same software libraries
that your Linux counterparts have already been using for months or years.
Of course you shouldn't just believe what I say without real concrete examples.
Luckily I have plenty.
So when I first started working with clients one major hurdle was installing the NUM pi stack those
basic libraries that these days you don't even have to install at all.
So num pi mapped out lib Panisse and CI pi usually would take hours to find and run custom Windows installers.
These days you can just download Anaconda and everything just works.
But remember that it took years for that to come out.
Another example is piano which was the original Deep Learning library that came with automatic differentiation
and GP you acceleration.
It's important to remember that for a long time piano was the only deep learning library around.
There was no such thing as tensor flow or PI talk.
So again it took years before you could install piano on Windows without having to spend all day on
it.
And even then you would be lucky if you got things working.
Now you might think whatever I don't care about the animal at the end was dead.
But you're forgetting that the same thing happened with tensor flow in Python.
When these libraries came out they also did not work on Windows for a very long time.
Now these days you might not care because the piano tensor to of Pi talk now all have windows support
but not so fast.
What about other libraries such as open a gym which is what you'll need if you're doing a reinforcement
learning.
Again limited support for Windows.
So it's up to you what you want to use based on these historical facts.
Should we use lessons from history to guide our future decisions.
I think most people would agree that's usually a good idea.
On the other hand there are good reasons to use Windows as well.
For one installing things on Windows is usually much easier than on linux.
You usually don't have to mess around with a terminal.
Most things are just click and go if you get one of the Lenovo laptops I recommend it previously.
Then you don't even have to install cuda.
It already comes pre installed on top of that the Cuda driver comes with a nice user interface.
So whenever you want to update CUDA all you have to do is open the user interface and click a few buttons.
You don't have such nice conveniences in Linux.
However you'll have to remember that CUDA is not the only thing you need.
You still need to install CUDA and then which is less easy.
This involves downloading a zip file copying the contents to specific folders and setting environment
variables.
Ultimately whether you use Windows or Linux you want to remember that there are two packages from and
video that you'll need to install CUDA included in it.
So first you install CUDA and then you install Cudi in at
now if you're having trouble deciding whether you want to use Windows Linux.
You don't have to.
Another option which is the one I prefer is to simply have both.
This is called dual booting.
If you got the Lenovo laptop I mentioned above.
It's actually quite nice because it comes with two drives so you can use the SSD to hold the operating
systems and then you can use the spinning disk for your data.
Alternatively you could use a separate drive for each operating system.
If this is what you're interested in there are a lot of tutorials out there that will walk you through
the process but these days it's pretty easy.
So you might not even need a tutorial since your computer comes with Windows pre installed.
You only need to install Linux to do that.
You just need to plug in your Linux installer on a USB stick and click a few buttons.
Just a warning though make sure you don't erase your entire disk and overwrite windows.
You want to choose the option to have windows alongside Linux at the same time.
So the next section here is all about how to install CUDA including then on Linux.
Personally I would recommend installing Linux distribution.
That's Ubuntu or debian based.
That includes other distributions such as pop OS Linux Mint ex Ubuntu L2 Bantu and Cuban too.
The reason why is because these tend to have the most support and the largest community.
So if you're having problems it'll be easier to find help.
Now this section really highlights the downsides of working with Linux.
Not only is it more difficult to install CUDA and Cudi and then compared to Windows there are many things
that can randomly go wrong.
I'm going to share a few examples with you just to help you understand what might happen.
So one thing that happened to me was I tried installing CUDA on linux mint but after installing it I
couldn't boot into the OS after restarting.
So that was obviously a no go because you can't use your computer if you can't even turn it on.
This was unfortunate because I really like Linux man another operating system I tried it was pop OS
populace is made by a company called system 76 which makes their own laptops that also come with and
video IGP use it turns out that they have their own way of installing CUDA drivers which is attractive
because it's just a few simple commands.
Unfortunately those commands didn't work.
In any case the method that works for me most consistently is to use the instructions from any videos
on Web site.
So first you have to install CUDA so you go to developer dot and video dot com slash CUDA downloads
then you select a few options specific to your system.
So if you're on a bunch to choose Linux 64 bit Ubuntu and so on then you get a link to a dab file once
you've downloaded that you can install it just like how you install all that files just use the command
sudo DP K.J. minus AI and then the file name next you have to install Cudi and then again the instructions
on end videos web site are what works for me consistently.
Basically it's just a few commands but I've pasted an example here.
So you know what it should look like if you're watching this in the future you should obviously check
in videos instructions to make sure that you get the most recent version of these commands
now for completion sake I also have a section here for windows.
Even though we kind of already discussed it as mentioned if you got one of the laptops above your windows
installation should have already come with cuda.
But if it didn't you can use the same link as above.
Developer that video dot com slash CUDA downloads.
This time you choose Windows and then you get an EMC file as usual installing with EMC files is super
easy.
You just click on it and then follow the prompts next you'll need to install Cudi and then as mentioned
previously this is currently a bit more complicated than just clicking in c file so click on the link
to go to the video site and do what they tell you to do.
Remember that these instructions may change but currently they involve downloading a zip file unzipping
that file placing the resulting files in various directories and setting some environment variables.
All right so now that we've taken care of the hardware and the low level drivers we can move up the
stack.
The first library we're going to look at how to install is tensor flow.
Lucky for you installing these libraries is now a lot easier than it used to be for tensor flow.
Traditionally you would have two commands one for the CB you version and one for the GOP version and
you'd have to pick the right one for your system for this tutorial.
Obviously the right one would be the GOP you version however with the most recent version of tensor
flow tensor flow two point one.
You can just do a pip install tensor flow and this automatically gives you a GP you capable version
of tensor flow.
You can check whether or not tensor flows using the GP you by going into Python inputting tensor flow
and then calling t after test dot is GP you available.
Next we have pi talk again.
It's just a simple Pip command pip install torch.
No difference between the CPSU and GP you if you want to check whether or not pi touches using the GP
you you can run these commands and you should get a similar output
next we have carrots since carrots works on top of tensor flow with piano.
You don't have to do anything special terraces installed as usual just pip installed carrots.
You just have to make sure that whatever back end you're using whether that's tensor flow with Yano
that they are cheap you enabled.
Finally we have piano today with libraries like tend to flow and Pi talks going higher level.
It's difficult to get a good feel for what actually happens inside a neural network.
There's too much distance between the theory and the code so you might not understand why you need all
those equations we learn about.
Even though those equations are what actually happened in the neural network so if piano is great for
understanding what it means to build a computational graph and a Y Harris has that compiler step for
Yentl.
My recommendation today is to use Anaconda whether you are on Windows Linux or Mac installing V.A. is
just the simple command Conda and staff piano.
If you want cheaper you capabilities you'll also want to install pi be you which can be done with Anaconda
as well
all right.
So there you have it.
Now you know how to set up a GP you enabled deep learning machine from start to finish at every layer
of the staff you learn how to choose the right laptop the pros and cons of each operating system how
to install all the necessary drivers and how to install deplaning libraries so that they make use of
the GP you.
As I mentioned earlier you have to make sure that you have the right version of everything since they
all have to match.
For example the latest version of tensor flow or PI talk won't work with older versions of cuda.
If you're installing everything from scratch and you're just getting the latest version of everything
you should be fine.
Otherwise you'll want to check the release notes on GitHub to see which versions of each component you
need.
The last thing I want to mention in this lecture is that I will not be answering questions on the Q
and A or via email about troubleshooting your setup.
This would be nearly impossible since I'm not there with you physically.
I don't have the same computer you have.
And even if I did the software I have might be a different version than what you have.
I would consider this to be a consulting service so if you really wanted my help on this you would have
to hire me as a consultant at the same time.
My current availability is very limited and I probably wouldn't accept such a job nor would you want
to pay hundreds of dollars per hour for it.
So your best bet if you need help troubleshooting is to check Google and most likely someone else will
have encountered the same problem as you.
If not then you should start a new thread on stack overflow or a similar forum and somebody who solve
the same problem before can assist you.