For those who run their own AI box, or want to

Thank you so much bencoman. Let me try it in base mamba and also look at the setup script you pointed me too. Thanks for the help. I really appreciate it. Will let you know how it goes.

HI Bencoman,

I have now tried it exactly like you did in the thread you showed me. I created a fresh install with WSL on a Windows laptop.

C:> wsl --unregister Ubuntu
C:> wsl --install -d Ubuntu

Logged into

hannes@CN73TL3:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION=“Ubuntu 20.04.5 LTS”

hannes@NTT-CN73TL3:~$ ping google.com
PING google.com (142.250.70.174) 56(84) bytes of data.
64 bytes from mel04s02-in-f14.1e100.net (142.250.70.174): icmp_seq=1 ttl=56 time=13.1 ms

Installed fastai:

wget -O - https://raw.githubusercontent.com/fastai/fastsetup/master/setup-conda.sh | /usr/bin/env bash

and lastly installed Jupyter and Jupyter lab:

(base) $mamba install -c conda-forge notebook
(base) $mamba install -c conda-forge nb_conda_kernels
(base) $mamba install -c conda-forge jupyter_contrib_nbextensions
(base) $mamba install -c fastchan fastai nbdev
(base) $mamba install -c conda-forge jupyterlab

(base) hannes@NTT-CN73TL3:~$ which jupyter
/home/hannes/mambaforge/bin/jupyter

This is the output that I got again.

It starts with a warning at the beginning:

/home/hannes/mambaforge/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter ‘pretrained’ is deprecated since 0.13 and may be removed in the future, please use ‘weights’ instead.
warnings.warn(
/home/hannes/mambaforge/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for ‘weights’ are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNet18_Weights.IMAGENET1K_V1. You can also use weights=ResNet18_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Downloading: “https://download.pytorch.org/models/resnet18-f37072fd.pth” to /home/hannes/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth
100%|██████████████████████████████████████████████████████████████████████████████| 44.7M/44.7M [00:05<00:00, 9.36MB/s]

0.00% [0/1 00:00<?]
epoch train_loss valid_loss error_rate time

7.14% [1/14 00:01<00:24]

TypeError Traceback (most recent call last)
Cell In [13], line 2
1 learn = vision_learner(dls, resnet18, metrics=error_rate)
----> 2 learn.fine_tune(3)

I am getting this error on this WSL2 newly installed instance as the dedicated Ubuntu 22.04.1 LTS version yesterday.

I really don’t know what I am doing wrong. Please help me.

This issue report might help you … I believe I had to modify the relevant file to fix that issue but it was a while back and so my memory is a bit hazy on things :slight_smile:

What version of Pytorch? Try 1.12.1 until fastai updates for 1.13 are rolled out.

FYI to print your fastai/pytorch version info. Try …

from fastai.test_utils import show_install
show_install()
2 Likes

@bencoman I am now running Fastai in a docker container on a Linux laptop.

I found the Dockerfile at GitHub - Paperspace/fastai-docker: Fast.AI course complete docker container for Paperspace and Gradient and it worked with GPU support.

I will go back to building it directly in Linux when I have more time to play and will be using the Docker file as reference

Thanks for your help. It was really helpful to get me started :smile:

1 Like

A few interesting vids I bumped into…

I’m not sure if these can ship international, but here is one of the shops mentioned…

I use xe.com to calculate currency exchange.
and btw, just a remidner of the obvious, right-clicking their web page gives…
image

But then, local ebay doesn’t seem too far off…

1 Like

My machine environments have become a mess after following various people’s ‘best practices’ for managing python envs and package dependencies.

I’ve tried all the solutions I can find for setting up a stable fastai env locally on Ubuntu 18.04.6 LTS and none of them have worked.

When I run: echo $PATH in my terminal this is the output:

/home/arthur/.pyenv/shims:/home/arthur/.pyenv/bin:/home/arthur/anaconda3/bin:/home/arthur/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/arthur/.local/share/JetBrains/Toolbox/scripts

Please could someone advise where I should go from here and ELI5

An outside the box suggestion on starting again

$ adduser otherme

At a minimum, you can review what the default minimal path is, to revert to in your original account. Or just continue in the new account.

2 Likes

Unsurprisingly everything works fine in a new account.

I think it’s time for a fresh OS install thank you @bencoman :pray:

1 Like

I’m not sure.

You didn’t report what you’d already researched, so try this first. Let us know what you learn.

I’m not a conda/mamba expert. I’ve only used it for the first time in this course.
Maybe try…

–force-reinstall
–update-all
https://docs.conda.io/projects/conda/en/latest/commands/install.html
https://docs.conda.io/projects/conda/en/latest/commands/update.html

1 Like

Any build part list for dual rtx 3090 TI Founder Edition build.
This system will be used for deep learning research in computer vision and nlp. Please help me to decide if you can ?

Thanks in Advance !

I am using my home PC, with Debian 12 “bookworm” (testing) and an NVIDIA GPU.

The following setup is not recommended unless you know what you’re doing with Linux, and probably not even then, but it’s working okay for me.

I decided not to use conda, virtualenv, or docker. Instead, I installed the necessary Python modules under /usr/local with pip. This way I can use my AI tools directly from the command line and other scripts, like any other tools.

It’s not safe to run pip install -U as root. It will merrily remove files from Debian-packaged Python modules under /usr/lib, and mess up the system. To avoid this, I changed permissions so that my regular user account can write to everything under /usr/local via the staff group:

sudo adduser $USER staff
sudo chgrp -R staff /usr/local
sudo chmod -R g+w /usr/local

This is somewhat of a security concern, but if a bad guy gets a local shell it’s pretty much game over anyway. To make it safer, I could have used a different non-root account.

In order to upgrade a pip package where the same package was also installed in /usr/lib by dpkg, I need to use pip -IU packagename. The -I flag tells it to ignore installed packages, i.e. don’t try to remove them. I only do that as needed for individual packages, when a normal upgrade fails.

This setup might upset Debian-packaged programs that depend on older versions of the Python libraries that I’ve upgraded. I haven’t noticed any problems like that yet.

2 Likes

My experience with setting up my box again with a clean ubuntu desktop was so much more pleasant as a few years ago.

I used the fastsetup.

my hurdles were:

  • I hadn’t installed curl and openssh server when running the initial script and so the script stopped half way, because those two were necessary.
  • rebooting after installation x.org server was broken showing me black screen dev/sda1: clean, 552599/6111232 files, 7119295/24414464 blocks. With ctrl-alt-f3 I was able to login and install the nvidia drivers as mentioned in the fastsetup. This fixed the issue.
2 Likes

Hi, I’m trying to setup a local windows machine just like Jeremy did in the live coding session 1:

  1. Install Terminal and WSL
  2. In WSL, do wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
  3. Install mambaforge via bash Mambaforge-Linux-x86_64.sh
  4. During installation, choose yes when asked if it should do an init
  5. Restart shell

Now the new python installation should be the default one (not the system python installation). However, which python returns the system python’s location (/usr/local/bin/python).

When opening a new shell, I get this message:

-bash: eval: line 195: syntax error near unexpected token `('
-bash: eval: line 195: `export CONDA_PROMPT_MODIFIER='(base) ''
(base) [user-name]@[computer-name]:~$

Does anyone have an idea what I need to do differently?

Executing conda init bash as described here doesn’t solve the issue.

Check for invalid chars in your path or unbalanced quotes as per …

1 Like

Thanks! Managed to solve it.

The problem was that WSL also imports path variables from Windows, and those contain empty spaces (e.g. “C:\Program Files\…”).

To prevent this, in WSL, I edited the /etc/wsl.conf file via the command sudo nano /etc/wsl.conf and added these lines:

[interop]
appendWindowsPath = false

(For anyone unfamiliar with nano: After editing, use Ctrl+X to exit, then Y to save, then Enter to confirm)

1 Like

I am really stuck on Chapter 2. I have tried to install windows terminal then use fastsetup on my own machine to create a demo. But unable to install. I first tried doing windows terminal but when I run wsl – install I get weird error as attached.

When I try to see wsl --list --all I get different error

However on my windows I can clearly see Linux environment

If anyone has done step-by-step of installing all relevant setups as explained by @jeremy in Chapter 2. I would really appreciate it.

I have bought his book as well but its not helping me with the setup part. Anyone?

I suspect you have not chosen a linux distro to install.

Refer to the instructions and trouble shooting on the MS wsl page.

NOTE from that page.
The above command only works if WSL is not installed at all, if you run wsl --install and see the WSL help text, please try running wsl --list --online to see a list of available distros and run wsl --install -d <DistroName> to install a distro. To uninstall WSL, see Uninstall legacy version of WSL or unregister or uninstall a Linux distribution.

Hi @AllenK thank you for picking this up. Should I install Ubuntu from here?

1 Like