Xilinx / brevitas-radioml-challenge-21

Apache License 2.0
15 stars 7 forks source link

Sandbox matplotlib_inline No Module Found Error #5

Closed bradstimpson closed 3 years ago

bradstimpson commented 3 years ago

Hello,

I am experiencing the following error when I try to run the provided training_and_evaluation notebook:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-037ec081c820> in <module>
      2 import torch
      3 import numpy as np
----> 4 import matplotlib.pyplot as plt
      5 from tqdm.notebook import tqdm

/opt/conda/lib/python3.8/site-packages/matplotlib/pyplot.py in <module>
   2318     dict.__setitem__(rcParams, "backend", rcsetup._auto_backend_sentinel)
   2319 # Set up the backend.
-> 2320 switch_backend(rcParams["backend"])
   2321 
   2322 # Just to be safe.  Interactive mode can be turned on without

/opt/conda/lib/python3.8/site-packages/matplotlib/pyplot.py in switch_backend(newbackend)
    258     backend_name = cbook._backend_module_name(newbackend)
    259 
--> 260     class backend_mod(matplotlib.backend_bases._Backend):
    261         locals().update(vars(importlib.import_module(backend_name)))
    262 

/opt/conda/lib/python3.8/site-packages/matplotlib/pyplot.py in backend_mod()
    259 
    260     class backend_mod(matplotlib.backend_bases._Backend):
--> 261         locals().update(vars(importlib.import_module(backend_name)))
    262 
    263     required_framework = _get_required_interactive_framework(backend_mod)

/opt/conda/lib/python3.8/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

ModuleNotFoundError: No module named 'matplotlib_inline'

I have tried running the environment on two separate systems and I am experiencing the same issue in both. Any help would be appreciated.

maltanar commented 3 years ago

Hi Brad, it looks like you are missing some dependencies. Are you following the Docker setup that is described in the README?

Executing ! pip list in the notebook should show a list of installed packages and help you debug this.

bradstimpson commented 3 years ago

Hi Maltanar,

I followed the README exactly as described, using the provided Dockerfile in this repo. Here is the !pip list:

Package                Version
---------------------- ----------------------------
argon2-cffi            20.1.0
async-generator        1.10
attrs                  19.3.0
backcall               0.2.0
beautifulsoup4         4.9.3
bitstring              3.1.7
bleach                 3.3.0
brevitas               0.6.0
brotlipy               0.7.0
certifi                2020.12.5
cffi                   1.14.3
chardet                3.0.4
clize                  4.1.1
conda                  4.9.2
conda-build            3.21.4
conda-package-handling 1.7.2
cryptography           3.2.1
cycler                 0.10.0
debugpy                1.3.0
decorator              4.4.2
defusedxml             0.7.1
dependencies           2.0.1
dill                   0.3.3
dnspython              2.1.0
docutils               0.17.1
entrypoints            0.3
filelock               3.0.12
finn-base              0.0.2b0.post0.dev35+g23e8105
future                 0.18.2
future-annotations     1.0.0
glob2                  0.7
h5py                   2.10.0
idna                   2.10
ipykernel              6.0.1
ipython                7.19.0
ipython-genutils       0.2.0
ipywidgets             7.6.3
jedi                   0.17.2
Jinja2                 2.11.2
joblib                 1.0.1
jsonschema             3.2.0
jupyter                1.0.0
jupyter-client         6.1.12
jupyter-console        6.4.0
jupyter-core           4.7.1
jupyterlab-pygments    0.1.2
jupyterlab-widgets     1.0.0
kiwisolver             1.3.1
libarchive-c           2.9
MarkupSafe             1.1.1
matplotlib             3.3.1
mistune                0.8.4
mkl-fft                1.2.0
mkl-random             1.1.1
mkl-service            2.3.0
mpmath                 1.2.1
nbclient               0.5.3
nbconvert              6.1.0
nbformat               5.1.3
ndindex                1.5.2
nest-asyncio           1.5.1
netron                 5.0.0
notebook               6.4.0
numpy                  1.18.0
od                     1.0
olefile                0.46
onnx                   1.7.0
onnxoptimizer          0.2.6
onnxruntime            1.4.0
packaging              21.0
pandas                 1.1.5
pandocfilters          1.4.3
parso                  0.7.0
pexpect                4.8.0
pickleshare            0.7.5
Pillow                 8.1.0
pip                    20.2.4
pkginfo                1.7.0
prometheus-client      0.11.0
prompt-toolkit         3.0.8
protobuf               3.17.3
psutil                 5.7.2
ptyprocess             0.7.0
pycosat                0.6.3
pycparser              2.20
Pygments               2.7.4
pyOpenSSL              19.1.0
pyparsing              2.4.7
pyrsistent             0.18.0
PySocks                1.7.1
python-dateutil        2.8.1
python-etcd            0.4.5
pytz                   2020.5
PyYAML                 5.3.1
pyzmq                  22.1.0
qtconsole              5.1.1
QtPy                   1.9.0
requests               2.24.0
ruamel-yaml            0.15.87
scikit-learn           0.24.1
scipy                  1.5.2
Send2Trash             1.7.1
setuptools             50.3.1.post20201107
sigtools               2.0.2
six                    1.15.0
soupsieve              2.1
sympy                  1.8
terminado              0.10.1
testpath               0.5.0
threadpoolctl          2.2.0
tokenize-rt            4.1.0
toposort               1.6
torch                  1.7.1
torchelastic           0.2.1
torchvision            0.8.2
tornado                6.1
tqdm                   4.61.1
traitlets              5.0.5
typing-extensions      3.7.4.3
urllib3                1.25.11
versioned-hdf5         1.3.1
wcwidth                0.2.5
webencodings           0.5.1
wheel                  0.35.1
widgetsnbextension     3.5.1

Also trying to do a reinstall of matplotlib gives me the following (using import sys !{sys.executable} -m pip install matplotlib):

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: matplotlib in /opt/conda/lib/python3.8/site-packages (3.3.1)
Requirement already satisfied: cycler>=0.10 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: numpy>=1.15 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (1.18.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (1.3.1)
Requirement already satisfied: certifi>=2020.06.20 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (2020.12.5)
Requirement already satisfied: pillow>=6.2.0 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (8.1.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in /opt/conda/lib/python3.8/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: six in /opt/conda/lib/python3.8/site-packages (from cycler>=0.10->matplotlib) (1.15.0)
fpjentzsch commented 3 years ago

Hi Brad,

the ipykernel package was updated recently (version 6.0.0), such that it now depends on matplotlib-inline for the inline backend mode (https://github.com/ipython/ipykernel/commit/f0d35275100c017fbe24b84a45ed0574b0ce71ef). I'm not sure why this new dependency is not reliably installed.

In any case, I pinned the ipykernel version to the previous (5.5.5) release (https://github.com/Xilinx/brevitas-radioml-challenge-21/commit/9eef6a2417d6a0c078bfcc3a4dc95033739c5550). Could you please check if the issue is solved on the latest main branch?

bradstimpson commented 3 years ago

Hi Felix,

Yes that fixed the problem - thank you for your help

nlhnt commented 2 years ago

Thank you, was having issues with this.