Machine Learning Enivorment Settings for Windows

1 minute read

Published:

This post will show you how to set up a machine learning enivorment for windows.

CUDA

  • First, check your GPU version. You can check by these steps:
    • Open the folder and click This PC.
    • Right click on the computer icon and select Properties
    • On the left side, click on the Device Mangager
    • Click on the Display Adapters, for example NVIDIA Geforce GTX 1650 Ti
  • Website
  • For me, I will choose to Download CUDA 11.7. To find the previous version, click here

cuDNN

  • Website
  • After downloading, unzip the file inside the folder that your CUDA installed.

Anaconda

  • Website
  • conda -V can check version
  • conda list will show all packages in current env
  • conda create -n [env name] python=3.8 can create a new enviroment based on python 3.8
  • conda activate [env name] can activate the enviroment
  • conda deactivate can leave the enivorment
  • conda env list can show all envs
  • conda remove -n ENV_NAME --all remove env
  • Remove the folder from that env

Some useful packages

  • scikit-learn conda install -c anaconda scikit-learn
  • matplotlib conda install matplotlib
  • pandas conda install pandas

Tensorflow (conda install)

After creating a new env bsed on anaconda and activate it.

  • Version check
  • Search tensorflow version conda search tensorflow
  • Search tensorflow-gpu conda search tensorflow-gpu
  • Install tensorflow conda install tensorflow
  • Install tensorflow-gpu conda install tensorflow-gpu
  • conda install tenssorflow==2.10.0
  • conda install tensorflow-gpu==2.6.0

Pytorch (conda install)

  • Website
  • conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
  • conda list can check if PyTorch is installed

Check GPU is used in PyTorch

import torch

torch.cuda.is_available()

torch.cuda.device_count()

torch.cuda.current_device()

torch.cuda.device(0)

torch.cuda.get_device_name(0)

Leave a Comment