A few years ago I tried learning Machine Learning / Deep Learning and setting up TensorFlow on my computer. I was not versed of any of the Python setup requirement, not to mention the potential conflicts between all the packages (not that I'm any good now). I even purchased a laptop with a separate GPU instead of Intel's built-in GPU, thinking that I would be able to accelerate the learning. Needless to say, I'm not certain if it's money well-spent, but I've certainly pushed my laptop as much as I can over the years.
Fast forward to recently that I'm restarting my ML / DL learning journey and would like to set up my system correctly this time. I reinstalled Python to get the latest version, as well as setting up a different environment under Anaconda. To my surprise, TensorFlow-gpu package is no longer supported because it has been merged with TensorFlow package (link). How hard can installation be, one would think, considering the popularity of TensorFlow in the Python ML / DL circle?
Let's just say the procedure on tensflow.org/install/pip didn't help. For whatever reasons, I was not able to get TensorFlow to see the GPU on my laptop after numerous tries. NVIDIA GeForce Experience software was also giving me a hard time installing the latest video card driver, not to mention NVIDIA's cuDNN toolkit installation instruction being a bit confusing. After fumbling around installing / uninstalling a few times, I was able to find a YouTube video providing the much needed help to get through. I'm attaching the link here for reference.
Copying from his YouTube page, I'm also adding some of my comments in blue because there's been changes since his video from '21. (credit - Aladdin Persson)
GO HERE FIRST:
https://www.tensorflow.org/install/source#gpu
- Follow the exact version listed on the webpage. Don't be like me thinking I could install newer versions of CUDA and cuDNN. 😶
1. Microsoft Visual Studio
* https://visualstudio.microsoft.com/vs...
- Use this link instead. You will need to signup for Microsoft developer account to download Microsoft Visual Studio Community 2019.
2. the NVIDIA CUDA Toolkit
https://developer.nvidia.com/cuda-toolkit-archive
3. NVIDIA cuDNN
https://developer.nvidia.com/cudnn
- You need to register with NVIDIA to download the file.
- Note that you need to copy and paste the files into the folder where the CUDA Toolkit installed on your drive.
4. Python (check compatible version from first link)
conda create --name tf_2.4 python==3.8
- You can name it anything you want (tf_2.4 to anything) and use the Python version you want to use.
5. Tensorflow (with GPU support)
pip install tensorflow
- Technically you should activate tf_2.4 (or whatever name you used to create the environment).
No comments:
Post a Comment