Local Setup on Windows, Linux & Mac

Many participants are facing issues while trying to run the notebooks locally on their computers. If you have figured it out, please post an explanation/tutorial here.

PyTorch and Jupyter for Win10

  1. Download & install Anaconda.
  2. Visit PyTorch official page, and go to Get Started section.
  3. There, go to the Start Locally section.
  4. Enter OS and other config details, copy the command given.
  5. Open Anaconda Prompt and paste the command.
  6. After PyTorch is installed, enter the following code: pip install jovian --upgrade
  7. Then clone notebook using: jovian clone aakashns/01-pytorch-basics
  8. Open the folder using: cd 01-pytorch-basics
  9. Finally type: jupyter notebook
  10. Jupyter opens up and then, select the notebook & Start Coding!

Links:

  1. PyTorch: https://pytorch.org/get-started/locally/
  2. Anaconda: https://www.anaconda.com/products/individual#Links

NOTE: If going for the GPU based PyTorch version, check your GPU CUDA compatibilty using chrome://gpu. Then, google about what CUDA version is supported on the basis of your PC’s compatibilty rating.

Although I do recommend using CPU only PyTorch, it’s tinsy bit slow but works well, you won’t actually feel the difference and TBH, even IDK what makes them both different. For CPU based PyTorch, in the Get Started section, under CUDA selection, click None.

2 Likes

please let me know what’s wrong

I have setup on local windows 7 and went to well until I got this error for jovian commit.
I have an error upon jovian.commit() on my jupyter notebook.
can anybody help me?
-----error message
[jovian] Attempting to save notebook…
[jovian] Error: Failed to detect notebook filename. Please provide the correct notebook filename as the “filename” argument to “jovian.commit”.

Hi Everyone,
I am trying to follow the steps listed in “02-Linear Regression” lecture to run the notebook on my local system but facing some issues as below. Kindly suggest what needs to be done here-

(base) D:\Projects\Jovian_Notebooks\02-linear-regression>jovian install
[jovian] Detected conda environment file: environment.yml

Please provide a name for the conda environment [notebook]: JovianEnv

[jovian] Executing:
conda env update --file “environment.yml” --name “JovianEnv”

Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • libstdcxx-ng=9.2.0
  • ld_impl_linux-64=2.33.1
  • libedit=3.1.20170329
  • libgfortran-ng=7.5.0
  • libgomp=9.2.0
  • readline=8.0
  • ncurses=6.1
  • _openmp_mutex=4.5
  • libgcc-ng=9.2.0

[jovian] Error: Installation failed!
[jovian] Ignoring unresolved dependencies and trying again…

[jovian] Executing:
conda env update --file “environment.yml” --name “JovianEnv”

Collecting package metadata (repodata.json): done
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

It may be that you need anaconda for opening those files or may be the python version on your desktop is not compatible. If it still exists then headover to stackexchange, there it is more likely that someone in your situation had earlier asked a question and got his/her answer.

Yea i had same problem bro, skip it and use binder and collab for now.
BUt if you wanna locally setup and have windows, try out this: Local Setup on Windows, Linux & Mac
NOTE: go for CPU (i.e. cuda=none0 PyTorch Installation. I have a GPU installation but i need to double check. I’ll write a medium post regarding that.

1 Like
  1. Have you cloned the NB using CMD?
  2. Or did you fork it to your jovian account, downloaded it and then opened jupyter?

I’m using Ubuntu 20.04. It is a massive pain to set everything up (TensorFlow specially) but it’s working well. GPU as well. If anyone need any pointers just let me know. Below is a very simple recipe using Anaconda:

conda create -n torchgpu pytorch jupyter matplotlib pandas scikit-learn
conda activate torchgpu
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

Then try these lines in a Jupyter Notebook:

import torch
print(f'PyTorch version= {torch.__version__}')
print(f'CUDA available= {torch.cuda.is_available()}')

1 Like

It was successfully installed, but when i try to import torch in my jupyter notebook, I get an error

Thank you valuat !

Unfortunately I get False, each time I try “torch.cuda.is_available()” and I am trying to solve this problem to use my GPU.
I have a geforce 2060, anaconda installed, with cudatoolkit installed and the latesta GPU driver.
Actually torch.cuda.is_available() gives me true when i used directly on my PC, but it gives me false when I am on a conda environment.
If anyone could help :slight_smile:

Are you using Linux? Those lines worked for me in both Ubuntu and macos. Haven’t tried them on Windows. In any case, you would need to install NVIDIA drivers (video, cuda and cudnn).

Have you tried the following command-line command before starting the Jupyter Notebook server?
conda activate torchgpu
Assuming you ran the lines exactly as I posted, you would’ve created a conda environment called torchgpu, that’s what the -n option does.
Then do

jupyter notebook

Open/create a notebook and issue the command import torch.

Perhaps installing the NVIDIA drivers? In Linux you’d need to install the video drivers, cuda drivers and cudnn library.

1 Like

Well I’am still trying. the drivers installed are the latest.
Maybe I should try VMs, but I am affraid that virtualization makes me loose some performance.