Show_results not showing anything

I’ve set up my own server, and am doing chapter 1 of the fastbook. For the pets example, the training works fine, however the following:

learner.show_results()

does nothing. There is no error, and I can see a progress bar for a bit, but then there are no images displayed afterwards.

Any idea on how to find out what’s wrong? I’ve looked at the source code but I get lost here. The preds does get generated (length 64 vector), but then somehow something goes wrong.

The same thing happens when I call show_results on the unet_learner for the image segmentation example in chapter 1.

Actually, when I do dls.show_batch() nothing happens either. Getting closer to the cause? What is the .show being called in this line, and how can I test it independently from the rest:

Can you explain how you’ve setup your server? OS? How did you install fastai?

(Generally when following the book that’s not recommended too)

1 Like

Thanks Zachary. I know it is recommended to use cloud services, it’s not just for following along with the book though.

I have a Ubuntu 20.04 box with a GTX 1080 Ti (driver version 470.57.02, which seems to work fine for training). I installed Miniconda as suggested in “Lesson 0”, here is the output of conda list if that helps:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
_pytorch_select           0.2                       gpu_0  
adal                      1.2.7                    pypi_0    pypi
aiohttp                   3.7.4.post0      py37h5e8e339_0    fastchan
argon2-cffi               20.1.0           py37h27cfd23_1  
asn1crypto                1.4.0                      py_0  
async-timeout             3.0.1            py37h06a4308_0  
async_generator           1.10             py37h28b3542_0  
attrs                     21.2.0             pyhd3eb1b0_0  
azure-cognitiveservices-search-imagesearch 2.0.0                    pypi_0    pypi
azure-common              1.1.27                   pypi_0    pypi
backcall                  0.2.0              pyhd3eb1b0_0  
beautifulsoup4            4.9.3              pyha847dfd_0  
blas                      1.0                         mkl  
bleach                    4.0.0              pyhd3eb1b0_0  
boto                      2.49.0                   py37_0  
boto3                     1.17.7             pyhd3eb1b0_0  
botocore                  1.20.7             pyhd8ed1ab_0    fastchan
bottleneck                1.3.2            py37heb32a55_1  
brotlipy                  0.7.0           py37h27cfd23_1003  
ca-certificates           2021.7.5             h06a4308_1  
cachetools                4.2.2              pyhd3eb1b0_0  
cairo                     1.14.12              h8948797_3  
catalogue                 2.0.4            py37h89c1867_0    fastchan
certifi                   2021.5.30        py37h06a4308_0  
cffi                      1.14.0           py37h2e261b9_0  
chardet                   4.0.0           py37h06a4308_1003  
click                     7.1.2                    pypi_0    pypi
colorama                  0.4.4              pyhd3eb1b0_0  
cryptography              2.3.1            py37hc365091_0  
cudatoolkit               10.0.130                      0  
cudnn                     7.6.5                cuda10.0_0  
cycler                    0.10.0                   py37_0  
cymem                     2.0.5            py37h2531618_0  
cython-blis               0.7.4            py37h27cfd23_1  
dataclasses               0.8                pyh6d0b6a4_7  
dbus                      1.13.18              hb2f20db_0  
decorator                 5.0.9              pyhd3eb1b0_0  
defusedxml                0.7.1              pyhd3eb1b0_0  
entrypoints               0.3                      py37_0  
expat                     2.4.1                h2531618_2  
fastai                    2.5.0                    pypi_0    pypi
fastbook                  0.0.18                   pypi_0    pypi
fastcore                  1.3.25                     py_0    fastai
fastdownload              0.0.3                    pypi_0    pypi
fastprogress              1.0.0              pyh39e3cac_0    fastchan
fastrelease               0.1.12                   pypi_0    pypi
fastscript                1.0.0                         0    fastai
fontconfig                2.13.1               h6c09931_0  
freetype                  2.10.4               h5ab3b9f_0  
fribidi                   1.0.10               h7b6447c_0  
ghapi                     0.1.19                   pypi_0    pypi
glib                      2.63.1               h5a9c865_0  
google-api-core           1.25.1             pyhd3eb1b0_0  
google-auth               1.28.0             pyhd3eb1b0_0  
google-cloud-core         1.6.0              pyhd3eb1b0_0  
google-cloud-storage      1.40.0             pyhd3eb1b0_0  
google-crc32c             1.1.2            py37h27cfd23_0  
google-resumable-media    1.3.1              pyhd3eb1b0_1  
googleapis-common-protos  1.53.0           py37h06a4308_0  
graphite2                 1.3.14               h23475e2_0  
graphviz                  2.40.1               h21bd128_2  
gst-plugins-base          1.14.0               hbbd80ab_1  
gstreamer                 1.14.0               hb453b48_1  
harfbuzz                  1.8.8                hffaf4a1_0  
icu                       58.2                 he6710b0_3  
idna                      2.10               pyhd3eb1b0_0  
importlib-metadata        3.10.0           py37h06a4308_0  
importlib_metadata        3.10.0               hd3eb1b0_0  
intel-openmp              2021.3.0          h06a4308_3350  
ipykernel                 5.3.4            py37h5ca1d4c_0  
ipython                   7.26.0           py37hb070fc8_0  
ipython_genutils          0.2.0              pyhd3eb1b0_1  
ipywidgets                7.6.3              pyhd3eb1b0_1  
isodate                   0.6.0                    pypi_0    pypi
jbig                      2.1                  hdba287a_0  
jedi                      0.18.0           py37h06a4308_1  
jinja2                    3.0.1              pyhd3eb1b0_0  
jmespath                  0.10.0                     py_0  
joblib                    1.0.1                    pypi_0    pypi
jpeg                      9d                   h36c2ea0_0    fastchan
jsonschema                3.2.0                      py_2  
jupyter                   1.0.0                    py37_7  
jupyter_client            6.1.12             pyhd3eb1b0_0  
jupyter_console           6.4.0              pyhd3eb1b0_0  
jupyter_core              4.7.1            py37h06a4308_0  
jupyterlab_pygments       0.1.2                      py_0  
jupyterlab_widgets        1.0.0              pyhd3eb1b0_1  
kiwisolver                1.3.1            py37h2531618_0  
lcms2                     2.12                 h3be6417_0  
lerc                      2.2.1                h2531618_0  
libcrc32c                 1.1.1                he6710b0_2  
libdeflate                1.7                  h27cfd23_5  
libedit                   3.1.20210216         h27cfd23_1  
libffi                    3.2.1             hf484d3e_1007  
libgcc-ng                 9.3.0               h5101ec6_17  
libgfortran-ng            7.5.0               h14aa051_19    fastchan
libgfortran4              7.5.0               h14aa051_19    fastchan
libgomp                   9.3.0               h5101ec6_17  
libpng                    1.6.37               hbc83047_0  
libprotobuf               3.16.0               h780b84a_0    fastchan
libsodium                 1.0.18               h7b6447c_0  
libstdcxx-ng              9.3.0               hd4cf53a_17  
libtiff                   4.3.0                hf544144_1    fastchan
libuuid                   1.0.3                h1bed415_2  
libwebp-base              1.2.0                h27cfd23_0  
libxcb                    1.14                 h7b6447c_0  
libxml2                   2.9.12               h03d6c58_0  
lz4-c                     1.9.3                h295c915_1  
markupsafe                2.0.1            py37h27cfd23_0  
matplotlib                3.3.2                         0    fastchan
matplotlib-base           3.3.2            py37h817c723_0  
matplotlib-inline         0.1.2              pyhd3eb1b0_2  
mistune                   0.8.4           py37h14c3975_1001  
mkl                       2020.2                      256  
mkl-service               2.3.0            py37he8ac12f_0  
mkl_fft                   1.3.0            py37h54f3939_0  
mkl_random                1.1.1            py37h0573a6f_0  
msrest                    0.6.21                   pypi_0    pypi
msrestazure               0.6.4                    pypi_0    pypi
multidict                 5.1.0            py37h27cfd23_2  
murmurhash                1.0.5            py37h2531618_0  
nbclient                  0.5.3              pyhd3eb1b0_0  
nbconvert                 5.6.1                    pypi_0    pypi
nbdev                     1.1.19                   pypi_0    pypi
nbformat                  5.1.3              pyhd3eb1b0_0  
ncurses                   6.2                  he6710b0_1  
nest-asyncio              1.5.1              pyhd3eb1b0_0  
ninja                     1.10.2               hff7bd54_1  
notebook                  6.4.0            py37h06a4308_0  
numexpr                   2.7.3            py37hb2eb853_0  
numpy                     1.19.2           py37h54aff64_0  
numpy-base                1.19.2           py37hfa32c7d_0  
nvidia-ml-py3             7.352.0                    py_0    fastchan
oauthlib                  3.1.1                    pypi_0    pypi
olefile                   0.46                     py37_0  
openjpeg                  2.3.0                h05c96fa_1  
openssl                   1.0.2u               h7b6447c_0  
packaging                 21.0               pyhd3eb1b0_0  
pandas                    1.3.1            py37h8c16a72_0  
pandocfilters             1.4.3            py37h06a4308_1  
pango                     1.42.4               h049681c_0  
parso                     0.8.2              pyhd3eb1b0_0  
pathy                     0.4.0              pyhd8ed1ab_0    fastchan
pcre                      8.45                 h295c915_0  
pexpect                   4.8.0              pyhd3eb1b0_3  
pickleshare               0.7.5           pyhd3eb1b0_1003  
pillow                    8.3.1            py37h2c7a002_0  
pip                       21.2.2           py37h06a4308_0  
pixman                    0.40.0               h7b6447c_0  
preshed                   3.0.5            py37h2531618_4  
prometheus_client         0.11.0             pyhd3eb1b0_0  
prompt-toolkit            3.0.17             pyh06a4308_0  
prompt_toolkit            3.0.17               hd3eb1b0_0  
protobuf                  3.16.0           py37hcd2ae1e_0    fastchan
ptyprocess                0.7.0              pyhd3eb1b0_2  
pyasn1                    0.4.8                      py_0  
pyasn1-modules            0.2.8                      py_0  
pycparser                 2.20                       py_2  
pydantic                  1.7.3            py37h27cfd23_0  
pygments                  2.9.0              pyhd3eb1b0_0  
pyjwt                     2.1.0                    pypi_0    pypi
pyopenssl                 19.0.0                   py37_0  
pyparsing                 2.4.7              pyhd3eb1b0_0  
pyqt                      5.9.2            py37h05f1152_2  
pyrsistent                0.17.3           py37h7b6447c_0  
pysocks                   1.7.1                    py37_1  
python                    3.7.0                h6e4f718_3  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-graphviz           0.16               pyhd3eb1b0_1  
python_abi                3.7                     1_cp37m    fastchan
pytorch-gpu               1.3.1                         0  
pytz                      2021.1             pyhd3eb1b0_0  
pyyaml                    5.4.1            py37h27cfd23_1  
pyzmq                     20.0.0           py37h2531618_1  
qt                        5.9.6                h8703b6f_2  
qtconsole                 5.1.0              pyhd3eb1b0_0  
qtpy                      1.9.0                      py_0  
readline                  7.0                  h7b6447c_5  
requests                  2.25.1             pyhd3eb1b0_0  
requests-oauthlib         1.3.0                    pypi_0    pypi
rsa                       4.7.2              pyhd3eb1b0_1  
s3transfer                0.3.6              pyhd3eb1b0_0  
scikit-learn              0.24.2                   pypi_0    pypi
scipy                     1.6.2            py37h91f5cce_0  
send2trash                1.5.0              pyhd3eb1b0_1  
sentencepiece             0.1.96                   pypi_0    pypi
setuptools                52.0.0           py37h06a4308_0  
shellingham               1.3.1                      py_0  
sip                       4.19.8           py37hf484d3e_0  
six                       1.16.0             pyhd3eb1b0_0  
smart_open                2.2.1                      py_0  
soupsieve                 2.2.1              pyhd3eb1b0_0  
spacy                     3.0.3            py37h6dcda5c_0    fastchan
spacy-legacy              3.0.8              pyhd8ed1ab_0    fastchan
sqlite                    3.33.0               h62c20be_0  
srsly                     2.4.0            py37hcd2ae1e_1    fastchan
terminado                 0.9.4            py37h06a4308_0  
testpath                  0.5.0              pyhd3eb1b0_0  
thinc                     8.0.3            py37hda21425_1    fastchan
threadpoolctl             2.2.0                    pypi_0    pypi
tk                        8.6.10               hbc83047_0  
torch                     1.9.0                    pypi_0    pypi
torchvision               0.10.0                   pypi_0    pypi
tornado                   6.1              py37h27cfd23_0  
tqdm                      4.62.0             pyhd3eb1b0_1  
traitlets                 5.0.5              pyhd3eb1b0_0  
typer                     0.3.1                      py_0    fastchan
typing-extensions         3.10.0.0             hd3eb1b0_0  
typing_extensions         3.10.0.0           pyh06a4308_0  
urllib3                   1.26.6             pyhd3eb1b0_1  
wasabi                    0.8.2              pyhd3eb1b0_0  
wcwidth                   0.2.5                      py_0  
webencodings              0.5.1                    py37_1  
wheel                     0.36.2             pyhd3eb1b0_0  
widgetsnbextension        3.5.1                    py37_0  
xz                        5.2.5                h7b6447c_0  
yaml                      0.2.5                h7b6447c_0  
yarl                      1.5.1            py37h7b6447c_0  
zeromq                    4.3.4                h2531618_0  
zipp                      3.5.0              pyhd3eb1b0_0  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.5.0                ha95c52a_0    fastchan

Additional note: I am also unable to plot the confusion matrix. Same thing as in the other cases, there is no error message when calling this:

interp = ClassificationInterpretation.from_learner(learner)

or this:

interp.plot_confusion_matrix()

However the matrix is just not displayed.

Could it be a matplotlib issue? Or do show_batch and show_results use something else?

Ah! If I run plt.show(), it now shows all the missing stuff at once!

And if I run

%matplotlib inline

then all the commands show what they’re supposed to (without needing plot.show()).

IiRC you need to set a notebook magic ( %% ) for plotting inline. Are you setting that?

Right!

%matplotlib inline

does the trick. Phew! Thanks.

Shouldn’t this be part of all notebooks then?

1 Like

Usually they are. But not all environments actually need it.

Eg Colab doesn’t

1 Like