If you have an issue in that you feel you are falling behind in your schedule then if you need to speed up that’s fine with me. What I note with V5 is that the lessons are much shorter in duration compared with previous version so I guess there is more pressure to get through all the material, perhaps Iam mistaken.
Please continue with your excellent work
So fastai lib will decide whether to use the GPU or not during training based on model size and/or dataset number of samples? I was going through the notebook of the 2nd chapter of the book and when training the bear classifier I noticed that nvidia-smi showed no activity on the GPU, even though I have a GPU available:
So I flushed my setup and used fastsetup this time, still nvidia-smi shows no process running on the GPU. Interestingly, nvtop does show memory usage while training the bear classifier.
yes… i tried watch nvidia-smi and no processes show up. As well, while looking at the help of nvidia-smi i saw you can probe in a loop using -l or --loop and tried that but same result, no processes.
Maybe it’s happening too fast? I’d try it with the imdb example in the first notebook with a large batch size (64) and run nvidia-smi -l to see if it hits the gpu or gpu ram? on a v100 it should take about 60-120 seconds per epoch IIRC … if it takes much much longer then it’s probably not hitting the GPU
I came up with a different solution, which was to create a new function python function reindex, which can be used to create unique pathnames across a set of directories.
reindex fixes this problem by uniquely reindexing all files within first-level directories of dest
It can be used from within python or from the shell. Here is how one would use it from the shell:
usage: reindex.py [-h] [--start_idx START_IDX] [--ext EXT] dest
Uniquely reindexes all files within first-level directories of `dest`
positional arguments:
dest Contains one or more directories
optional arguments:
-h, --help show this help message and exit
--start_idx START_IDX
Starting index across all files
--ext EXT Optional file extention
Ok, that’s a good point, maybe an epoch lasts less than 60 secs for the bear classifier, I’ll try your suggestion. Now, I am sure it is using the GPU as nvtop shows memory being used in the GPU the training, as I pointed out previously
[Edit]
I upgraded last week to Win 11 to get a WSL2 Ubuntu environment to use with this for this course. Win 11 allows Linux GUI apps to display seemlessly next to Windows Desktop apps.
Since VSCode and Codium are the same code base, they both give the following error when installed and run using “code .” at a WSL prompt.
To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.
So both seem hardcoded to operate only with Linux as a VS Code Server.
I use nvtop a lot, can def. recommend leave it running in the terminal to monitor gpu usage. You seem to be missing some fonts, or the terminal is somehow not setup to use utf-8 characters. It generally looks a lot better.
also, given all the N/As in the screenshot, you could either be running it inside the container or with not enough permissions. you should see able to see more details when running with enough credentials(sudo perhaps) on the host itself.
Ah I see. I couldn’t make heads or tails of it maybe something’s wrong with the terminal font? I usually just run nvidia-smi -l in a terminal (within my paperspace container) and run the training in the notebook that connects to the container all on my local machine. With a reasonable batchsize (64 or above) for the IMDB example in the first notebook, you should see 8GB+ utilization on the GPU, At least that’s what I see on my 8GB 1070ti …
EDIT: To clarify, I run a docker container (built with fastai+fastbook and published by paperspace) on my local server at home.
thank you for pointing that out … I did not pay attention to those weird characters before as i had no idea how the output of nvtop should really look like . It seems this is an issue of the ncurses lib and UTF-8 locale so doing export NCURSES_NO_UTF8_ACS=1 will fix the handling of line-drawing glyphs .
# What version of Python do you have?
import sys
import torch
import pandas as pd
import sklearn as sk
print(f"PyTorch Version: {torch.__version__}")
print()
print(f"Python {sys.version}")
print(f"Pandas {pd.__version__}")
print(f"Scikit-Learn {sk.__version__}")
print("GPU is", "available" if torch.cuda.is_available() else "NOT AVAILABLE")
https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/pytorch-install-jul-2020.ipynb