Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import torch always leads to Kernel Restarting #717

Closed
roualdes opened this issue Oct 16, 2023 · 10 comments
Closed

Import torch always leads to Kernel Restarting #717

roualdes opened this issue Oct 16, 2023 · 10 comments

Comments

@roualdes
Copy link

Description

When attempting to use PyTorch, the kernel restarts itself. In a fresh install of JupyterLab Desktop on Mac OS 12.7, but also on a number of my students machines both Macs and Windows, a Kernel Restarting message appears while attempting to use torch.

Reproduce

The following two code cells consistently reproduce a Kernel Restarting message on my Mac OS 12.7 in a fresh install of JupyterLab Deskop on Mac OS 12.7. The first cell executes as expected, and the second produces a Kernel Restarting message as often as I rerun the second cell.

!pip install torch torchvision

which successfully runs. But then executing

import torch

fails with a Kernel Restarting message: The kernel for Untitled1.ipynb appears to have died. It will restart automatically.

Expected behavior

The code chunks above run and torch works normally on a CPU (with no GPU).

Context

Mac OS 12.7
JupyterLab Desktop Version 4.0.5
Installer: .dmg

Troubleshoot Output
~ % jupyter troubleshoot
[notice] A new release of pip available: 22.3.1 -> 23.3
[notice] To update, run: python3.9 -m pip install --upgrade pip
$PATH:
        /Applications/Julia-1.9.app/Contents/Resources/julia/bin
        /usr/local/bin
        /usr/bin
        /bin
        /usr/sbin
        /sbin
        /Library/TeX/texbin
        /opt/X11/bin
        /Library/Apple/usr/bin
        /Applications/quarto/bin
        /Users/edward/Library/jupyterlab-desktop/jlab_server/bin
        /Applications/Julia-1.9.app/Contents/Resources/julia/bin
        /node_modules/.bin
        /Applications/JupyterLab.app/Contents/MacOS

sys.path:
/usr/local/bin
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python39.zip
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9
/usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload
/usr/local/lib/python3.9/site-packages

sys.executable:
/usr/local/opt/python@3.9/bin/python3.9

sys.version:
3.9.16 (main, Dec 7 2022, 10:15:43)
[Clang 14.0.0 (clang-1400.0.29.202)]

platform.platform():
macOS-12.7-x86_64-i386-64bit

which -a jupyter:
/usr/local/bin/jupyter
/Users/edward/Library/jupyterlab-desktop/jlab_server/bin/jupyter

pip list:
Package Version
------------------- -----------
attrs 22.1.0
cffi 1.15.1
entrypoints 0.4
fastjsonschema 2.16.2
jsonschema 4.17.1
jupyter_client 7.4.7
jupyter_core 5.1.0
jupyterlab-pygments 0.2.2
MarkupSafe 2.1.1
mistune 2.0.4
nbclient 0.7.1
nbformat 5.7.0
nest-asyncio 1.5.6
packaging 21.3
pandocfilters 1.5.0
parso 0.8.3
pip 22.3.1
platformdirs 2.5.4
ptyprocess 0.7.0
pure-eval 0.2.2
pycparser 2.21
Pygments 2.13.0
pyparsing 3.0.9
pyrsistent 0.19.2
python-dateutil 2.8.2
pyzmq 24.0.1
setuptools 65.6.3
six 1.16.0
sniffio 1.3.0
soupsieve 2.3.2.post1
tinycss2 1.2.1
tornado 6.2
traitlets 5.6.0
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.38.4
zipp 3.11.0

conda list:
# packages in environment at /Users/edward/Library/jupyterlab-desktop/jlab_server:
#
# Name Version Build Channel
anyio 3.7.1 pyhd8ed1ab_0 conda-forge
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py38hef030d1_3 conda-forge
arrow 1.2.3 pyhd8ed1ab_0 conda-forge
asttokens 2.2.1 pyhd8ed1ab_0 conda-forge
async-lru 2.0.4 pyhd8ed1ab_0 conda-forge
attrs 23.1.0 pyh71513ae_1 conda-forge
babel 2.12.1 pyhd8ed1ab_1 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 pyhd8ed1ab_3 conda-forge
backports.functools_lru_cache 1.6.5 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.12.2 pyha770c72_0 conda-forge
bleach 6.0.0 pyhd8ed1ab_0 conda-forge
boltons 23.0.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 hb7f2c08_9 conda-forge
brotli-bin 1.0.9 hb7f2c08_9 conda-forge
brotli-python 1.0.9 py38h4cd09af_9 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
ca-certificates 2023.7.22 h8857fd0_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2023.7.22 pyhd8ed1ab_0 conda-forge
cffi 1.15.1 py38hb368cf1_3 conda-forge
charset-normalizer 3.2.0 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
comm 0.1.4 pyhd8ed1ab_0 conda-forge
conda 23.7.2 py38h50d1736_0 conda-forge
conda-package-handling 2.2.0 pyh38be061_0 conda-forge
conda-package-streaming 0.9.0 pyhd8ed1ab_0 conda-forge
contourpy 1.1.0 py38h15a1a5b_0 conda-forge
cryptography 41.0.3 py38he13da33_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
debugpy 1.6.8 py38h940360d_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.1.3 pyhd8ed1ab_0 conda-forge
executing 1.2.0 pyhd8ed1ab_0 conda-forge
filelock 3.12.4 pypi_0 pypi
flit-core 3.9.0 pyhd8ed1ab_0 conda-forge
fonttools 4.42.0 py38hcafd530_0 conda-forge
fqdn 1.5.1 pyhd8ed1ab_0 conda-forge
freetype 2.12.1 h3f81eb7_1 conda-forge
fsspec 2023.9.2 pypi_0 pypi
idna 3.4 pyhd8ed1ab_0 conda-forge
importlib-metadata 6.8.0 pyha770c72_0 conda-forge
importlib-resources 6.0.1 pyhd8ed1ab_0 conda-forge
importlib_metadata 6.8.0 hd8ed1ab_0 conda-forge
importlib_resources 6.0.1 pyhd8ed1ab_0 conda-forge
ipykernel 6.25.1 pyh5fb750a_0 conda-forge
ipympl 0.9.3 pyhd8ed1ab_0 conda-forge
ipython 8.12.0 pyhd1c38e8_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 8.1.0 pyhd8ed1ab_0 conda-forge
isoduration 20.11.0 pyhd8ed1ab_0 conda-forge
jedi 0.19.0 pyhd8ed1ab_0 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
json5 0.9.14 pyhd8ed1ab_0 conda-forge
jsonpatch 1.32 pyhd8ed1ab_0 conda-forge
jsonpointer 2.0 py_0 conda-forge
jsonschema 4.19.0 pyhd8ed1ab_1 conda-forge
jsonschema-specifications 2023.7.1 pyhd8ed1ab_0 conda-forge
jsonschema-with-format-nongpl 4.19.0 pyhd8ed1ab_1 conda-forge
jupyter-lsp 2.2.0 pyhd8ed1ab_0 conda-forge
jupyter_client 8.3.0 pyhd8ed1ab_0 conda-forge
jupyter_core 5.3.1 py38h50d1736_0 conda-forge
jupyter_events 0.7.0 pyhd8ed1ab_2 conda-forge
jupyter_server 2.7.1 pyhd8ed1ab_0 conda-forge
jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge
jupyterlab 4.0.5 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.24.0 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 3.0.8 pyhd8ed1ab_0 conda-forge
kiwisolver 1.4.4 py38h98b9b1b_1 conda-forge
lcms2 2.15 h2dcdeff_1 conda-forge
lerc 4.0.0 hb486fe8_0 conda-forge
libblas 3.9.0 17_osx64_openblas conda-forge
libbrotlicommon 1.0.9 hb7f2c08_9 conda-forge
libbrotlidec 1.0.9 hb7f2c08_9 conda-forge
libbrotlienc 1.0.9 hb7f2c08_9 conda-forge
libcblas 3.9.0 17_osx64_openblas conda-forge
libcxx 16.0.6 hd57cbcb_0 conda-forge
libdeflate 1.18 hac1461d_0 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgfortran 5.0.0 12_3_0_h97931a8_1 conda-forge
libgfortran5 12.3.0 hbd3c1fe_1 conda-forge
libjpeg-turbo 2.1.5.1 hb7f2c08_0 conda-forge
liblapack 3.9.0 17_osx64_openblas conda-forge
libopenblas 0.3.23 openmp_h429af6e_0 conda-forge
libpng 1.6.39 ha978bb4_0 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libsqlite 3.42.0 h58db7d2_0 conda-forge
libtiff 4.5.1 hf955e92_0 conda-forge
libwebp-base 1.3.1 h0dc2134_0 conda-forge
libxcb 1.15 hb7f2c08_0 conda-forge
libzlib 1.2.13 h8a1eda9_5 conda-forge
llvm-openmp 16.0.6 hff08bdf_0 conda-forge
markupsafe 2.1.3 py38hcafd530_0 conda-forge
matplotlib-base 3.7.2 py38h6e6aad2_0 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
mistune 3.0.1 pyhd8ed1ab_0 conda-forge
mpmath 1.3.0 pypi_0 pypi
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
nbclient 0.8.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.7.4 pyhd8ed1ab_0 conda-forge
nbformat 5.9.2 pyhd8ed1ab_0 conda-forge
ncurses 6.4 hf0c8a7f_0 conda-forge
nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge
networkx 3.1 pypi_0 pypi
notebook-shim 0.2.3 pyhd8ed1ab_0 conda-forge
numpy 1.24.4 py38h9a4a08f_0 conda-forge
openjpeg 2.5.0 h13ac156_2 conda-forge
openssl 3.1.2 h8a1eda9_0 conda-forge
overrides 7.4.0 pyhd8ed1ab_0 conda-forge
packaging 23.1 pyhd8ed1ab_0 conda-forge
pandas 2.0.3 py38h78e6021_1 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pexpect 4.8.0 pyh1a96a4e_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 10.0.0 py38h16710f9_0 conda-forge
pip 23.2.1 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
platformdirs 3.10.0 pyhd8ed1ab_0 conda-forge
pluggy 1.2.0 pyhd8ed1ab_0 conda-forge
pooch 1.7.0 pyha770c72_3 conda-forge
prometheus_client 0.17.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.39 pyha770c72_0 conda-forge
prompt_toolkit 3.0.39 hd8ed1ab_0 conda-forge
psutil 5.9.5 py38hef030d1_0 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pycosat 0.6.4 py38hef030d1_1 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.16.1 pyhd8ed1ab_0 conda-forge
pyobjc-core 9.2 py38h095c2e5_0 conda-forge
pyobjc-framework-cocoa 9.2 py38h095c2e5_0 conda-forge
pyopenssl 23.2.0 pyhd8ed1ab_1 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
python 3.8.17 hf9b03c3_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.18.0 pyhd8ed1ab_0 conda-forge
python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge
python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge
python_abi 3.8 3_cp38 conda-forge
pytz 2023.3 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py38hef030d1_5 conda-forge
pyzmq 25.1.1 py38h3b70857_0 conda-forge
readline 8.2 h9e318b2_1 conda-forge
referencing 0.30.2 pyhd8ed1ab_0 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge
rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge
rpds-py 0.9.2 py38h7510fb3_0 conda-forge
ruamel.yaml 0.17.32 py38hcafd530_0 conda-forge
ruamel.yaml.clib 0.2.7 py38hef030d1_1 conda-forge
scipy 1.10.1 py38h9cf86d3_3 conda-forge
send2trash 1.8.2 pyhd1c38e8_0 conda-forge
setuptools 68.0.0 pyhd8ed1ab_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sniffio 1.3.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
sympy 1.12 pypi_0 pypi
terminado 0.17.1 pyhd1c38e8_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
toolz 0.12.0 pyhd8ed1ab_0 conda-forge
torch 2.1.0 pypi_0 pypi
torchvision 0.16.0 pypi_0 pypi
tornado 6.3.3 py38hcafd530_0 conda-forge
tqdm 4.66.1 pyhd8ed1ab_0 conda-forge
traitlets 5.9.0 pyhd8ed1ab_0 conda-forge
typing-extensions 4.7.1 hd8ed1ab_0 conda-forge
typing_extensions 4.7.1 pyha770c72_0 conda-forge
typing_utils 0.1.0 pyhd8ed1ab_0 conda-forge
unicodedata2 15.0.0 py38hef030d1_0 conda-forge
uri-template 1.3.0 pyhd8ed1ab_0 conda-forge
urllib3 2.0.4 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge
webcolors 1.13 pyhd8ed1ab_0 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.6.1 pyhd8ed1ab_0 conda-forge
wheel 0.41.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 4.0.8 pyhd8ed1ab_0 conda-forge
xorg-libxau 1.0.11 h0dc2134_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xz 5.2.6 h775f41a_0 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.16.2 pyhd8ed1ab_0 conda-forge
zstandard 0.19.0 py38hd8fc1c9_2 conda-forge
zstd 1.5.2 h829000d_7 conda-forge

conda env:
name: base
channels:
- conda-forge
- defaults
dependencies:
- anyio=3.7.1=pyhd8ed1ab_0
- appnope=0.1.3=pyhd8ed1ab_0
- argon2-cffi=21.3.0=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py38hef030d1_3
- arrow=1.2.3=pyhd8ed1ab_0
- asttokens=2.2.1=pyhd8ed1ab_0
- async-lru=2.0.4=pyhd8ed1ab_0
- attrs=23.1.0=pyh71513ae_1
- babel=2.12.1=pyhd8ed1ab_1
- backcall=0.2.0=pyh9f0ad1d_0
- backports=1.0=pyhd8ed1ab_3
- backports.functools_lru_cache=1.6.5=pyhd8ed1ab_0
- beautifulsoup4=4.12.2=pyha770c72_0
- bleach=6.0.0=pyhd8ed1ab_0
- boltons=23.0.0=pyhd8ed1ab_0
- brotli=1.0.9=hb7f2c08_9
- brotli-bin=1.0.9=hb7f2c08_9
- brotli-python=1.0.9=py38h4cd09af_9
- bzip2=1.0.8=h0d85af4_4
- ca-certificates=2023.7.22=h8857fd0_0
- cached-property=1.5.2=hd8ed1ab_1
- cached_property=1.5.2=pyha770c72_1
- certifi=2023.7.22=pyhd8ed1ab_0
- cffi=1.15.1=py38hb368cf1_3
- charset-normalizer=3.2.0=pyhd8ed1ab_0
- colorama=0.4.6=pyhd8ed1ab_0
- comm=0.1.4=pyhd8ed1ab_0
- conda=23.7.2=py38h50d1736_0
- conda-package-handling=2.2.0=pyh38be061_0
- conda-package-streaming=0.9.0=pyhd8ed1ab_0
- contourpy=1.1.0=py38h15a1a5b_0
- cryptography=41.0.3=py38he13da33_0
- cycler=0.11.0=pyhd8ed1ab_0
- debugpy=1.6.8=py38h940360d_0
- decorator=5.1.1=pyhd8ed1ab_0
- defusedxml=0.7.1=pyhd8ed1ab_0
- entrypoints=0.4=pyhd8ed1ab_0
- exceptiongroup=1.1.3=pyhd8ed1ab_0
- executing=1.2.0=pyhd8ed1ab_0
- flit-core=3.9.0=pyhd8ed1ab_0
- fonttools=4.42.0=py38hcafd530_0
- fqdn=1.5.1=pyhd8ed1ab_0
- freetype=2.12.1=h3f81eb7_1
- idna=3.4=pyhd8ed1ab_0
- importlib-metadata=6.8.0=pyha770c72_0
- importlib-resources=6.0.1=pyhd8ed1ab_0
- importlib_metadata=6.8.0=hd8ed1ab_0
- importlib_resources=6.0.1=pyhd8ed1ab_0
- ipykernel=6.25.1=pyh5fb750a_0
- ipympl=0.9.3=pyhd8ed1ab_0
- ipython=8.12.0=pyhd1c38e8_0
- ipython_genutils=0.2.0=py_1
- ipywidgets=8.1.0=pyhd8ed1ab_0
- isoduration=20.11.0=pyhd8ed1ab_0
- jedi=0.19.0=pyhd8ed1ab_0
- jinja2=3.1.2=pyhd8ed1ab_1
- json5=0.9.14=pyhd8ed1ab_0
- jsonpatch=1.32=pyhd8ed1ab_0
- jsonpointer=2.0=py_0
- jsonschema=4.19.0=pyhd8ed1ab_1
- jsonschema-specifications=2023.7.1=pyhd8ed1ab_0
- jsonschema-with-format-nongpl=4.19.0=pyhd8ed1ab_1
- jupyter-lsp=2.2.0=pyhd8ed1ab_0
- jupyter_client=8.3.0=pyhd8ed1ab_0
- jupyter_core=5.3.1=py38h50d1736_0
- jupyter_events=0.7.0=pyhd8ed1ab_2
- jupyter_server=2.7.1=pyhd8ed1ab_0
- jupyter_server_terminals=0.4.4=pyhd8ed1ab_1
- jupyterlab=4.0.5=pyhd8ed1ab_0
- jupyterlab_pygments=0.2.2=pyhd8ed1ab_0
- jupyterlab_server=2.24.0=pyhd8ed1ab_0
- jupyterlab_widgets=3.0.8=pyhd8ed1ab_0
- kiwisolver=1.4.4=py38h98b9b1b_1
- lcms2=2.15=h2dcdeff_1
- lerc=4.0.0=hb486fe8_0
- libblas=3.9.0=17_osx64_openblas
- libbrotlicommon=1.0.9=hb7f2c08_9
- libbrotlidec=1.0.9=hb7f2c08_9
- libbrotlienc=1.0.9=hb7f2c08_9
- libcblas=3.9.0=17_osx64_openblas
- libcxx=16.0.6=hd57cbcb_0
- libdeflate=1.18=hac1461d_0
- libffi=3.4.2=h0d85af4_5
- libgfortran=5.0.0=12_3_0_h97931a8_1
- libgfortran5=12.3.0=hbd3c1fe_1
- libjpeg-turbo=2.1.5.1=hb7f2c08_0
- liblapack=3.9.0=17_osx64_openblas
- libopenblas=0.3.23=openmp_h429af6e_0
- libpng=1.6.39=ha978bb4_0
- libsodium=1.0.18=hbcb3906_1
- libsqlite=3.42.0=h58db7d2_0
- libtiff=4.5.1=hf955e92_0
- libwebp-base=1.3.1=h0dc2134_0
- libxcb=1.15=hb7f2c08_0
- libzlib=1.2.13=h8a1eda9_5
- llvm-openmp=16.0.6=hff08bdf_0
- markupsafe=2.1.3=py38hcafd530_0
- matplotlib-base=3.7.2=py38h6e6aad2_0
- matplotlib-inline=0.1.6=pyhd8ed1ab_0
- mistune=3.0.1=pyhd8ed1ab_0
- munkres=1.1.4=pyh9f0ad1d_0
- nbclient=0.8.0=pyhd8ed1ab_0
- nbconvert-core=7.7.4=pyhd8ed1ab_0
- nbformat=5.9.2=pyhd8ed1ab_0
- ncurses=6.4=hf0c8a7f_0
- nest-asyncio=1.5.6=pyhd8ed1ab_0
- notebook-shim=0.2.3=pyhd8ed1ab_0
- numpy=1.24.4=py38h9a4a08f_0
- openjpeg=2.5.0=h13ac156_2
- openssl=3.1.2=h8a1eda9_0
- overrides=7.4.0=pyhd8ed1ab_0
- packaging=23.1=pyhd8ed1ab_0
- pandas=2.0.3=py38h78e6021_1
- pandocfilters=1.5.0=pyhd8ed1ab_0
- parso=0.8.3=pyhd8ed1ab_0
- pexpect=4.8.0=pyh1a96a4e_2
- pickleshare=0.7.5=py_1003
- pillow=10.0.0=py38h16710f9_0
- pip=23.2.1=pyhd8ed1ab_0
- pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
- platformdirs=3.10.0=pyhd8ed1ab_0
- pluggy=1.2.0=pyhd8ed1ab_0
- pooch=1.7.0=pyha770c72_3
- prometheus_client=0.17.1=pyhd8ed1ab_0
- prompt-toolkit=3.0.39=pyha770c72_0
- prompt_toolkit=3.0.39=hd8ed1ab_0
- psutil=5.9.5=py38hef030d1_0
- pthread-stubs=0.4=hc929b4f_1001
- ptyprocess=0.7.0=pyhd3deb0d_0
- pure_eval=0.2.2=pyhd8ed1ab_0
- pycosat=0.6.4=py38hef030d1_1
- pycparser=2.21=pyhd8ed1ab_0
- pygments=2.16.1=pyhd8ed1ab_0
- pyobjc-core=9.2=py38h095c2e5_0
- pyobjc-framework-cocoa=9.2=py38h095c2e5_0
- pyopenssl=23.2.0=pyhd8ed1ab_1
- pyparsing=3.0.9=pyhd8ed1ab_0
- pysocks=1.7.1=pyha2e5f31_6
- python=3.8.17=hf9b03c3_0_cpython
- python-dateutil=2.8.2=pyhd8ed1ab_0
- python-fastjsonschema=2.18.0=pyhd8ed1ab_0
- python-json-logger=2.0.7=pyhd8ed1ab_0
- python-tzdata=2023.3=pyhd8ed1ab_0
- python_abi=3.8=3_cp38
- pytz=2023.3=pyhd8ed1ab_0
- pyyaml=6.0=py38hef030d1_5
- pyzmq=25.1.1=py38h3b70857_0
- readline=8.2=h9e318b2_1
- referencing=0.30.2=pyhd8ed1ab_0
- requests=2.31.0=pyhd8ed1ab_0
- rfc3339-validator=0.1.4=pyhd8ed1ab_0
- rfc3986-validator=0.1.1=pyh9f0ad1d_0
- rpds-py=0.9.2=py38h7510fb3_0
- ruamel.yaml=0.17.32=py38hcafd530_0
- ruamel.yaml.clib=0.2.7=py38hef030d1_1
- scipy=1.10.1=py38h9cf86d3_3
- send2trash=1.8.2=pyhd1c38e8_0
- setuptools=68.0.0=pyhd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- sniffio=1.3.0=pyhd8ed1ab_0
- soupsieve=2.3.2.post1=pyhd8ed1ab_0
- stack_data=0.6.2=pyhd8ed1ab_0
- terminado=0.17.1=pyhd1c38e8_0
- tinycss2=1.2.1=pyhd8ed1ab_0
- tk=8.6.12=h5dbffcc_0
- tomli=2.0.1=pyhd8ed1ab_0
- toolz=0.12.0=pyhd8ed1ab_0
- tornado=6.3.3=py38hcafd530_0
- tqdm=4.66.1=pyhd8ed1ab_0
- traitlets=5.9.0=pyhd8ed1ab_0
- typing-extensions=4.7.1=hd8ed1ab_0
- typing_extensions=4.7.1=pyha770c72_0
- typing_utils=0.1.0=pyhd8ed1ab_0
- unicodedata2=15.0.0=py38hef030d1_0
- uri-template=1.3.0=pyhd8ed1ab_0
- urllib3=2.0.4=pyhd8ed1ab_0
- wcwidth=0.2.6=pyhd8ed1ab_0
- webcolors=1.13=pyhd8ed1ab_0
- webencodings=0.5.1=py_1
- websocket-client=1.6.1=pyhd8ed1ab_0
- wheel=0.41.1=pyhd8ed1ab_0
- widgetsnbextension=4.0.8=pyhd8ed1ab_0
- xorg-libxau=1.0.11=h0dc2134_0
- xorg-libxdmcp=1.1.3=h35c211d_0
- xz=5.2.6=h775f41a_0
- yaml=0.2.5=h0d85af4_2
- zeromq=4.3.4=he49afe7_1
- zipp=3.16.2=pyhd8ed1ab_0
- zstandard=0.19.0=py38hd8fc1c9_2
- zstd=1.5.2=h829000d_7
- pip:
- filelock==3.12.4
- fsspec==2023.9.2
- mpmath==1.3.0
- networkx==3.1
- sympy==1.12
- torch==2.1.0
- torchvision==0.16.0
prefix: /Users/edward/Library/jupyterlab-desktop/jlab_server

@roualdes roualdes added the bug label Oct 16, 2023
@welcome
Copy link

welcome bot commented Oct 16, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@mbektas
Copy link
Member

mbektas commented Oct 17, 2023

I was able to reproduce the issue. I cannot tell what the root cause is. possibly some configuration with torch library. I got it working by installing with conda. Could you try that? In a code cell you can run:

%conda install -c conda-forge pytorch torchvision

@JasonWeill
Copy link

Thanks @mbektas ! Also, does this occur with JupyterLab, IPython, or any other Jupyter client, or is it specific to JupyterLab Desktop? Thanks!

@roualdes
Copy link
Author

Thanks to you both for looking at this.

So far, a conda install appears to be working. I'll report back more about a conda install after I try a few more machines and OSes.

I developed the notebook for which I discovered this bug using JupyterLab (launched from command line). It was only when I opened the notebook using JupyterLab Desktop that the bug surfaced. I can reproduce the bug in JupyterLab Desktop, but not JupyterLab. I haven't tried other Jupyter clients.

@mbektas
Copy link
Member

mbektas commented Oct 22, 2023

@roualdes I had tested with JupyterLab web application and had the same issue. Make sure you test with the same Python package versions of jupyterlab and pytorch & torchvision. It doesn't appear to be desktop application specific issue.

@JasonWeill
Copy link

@mbektas Should we move this issue to the jupyterlab/jupyterlab repo?

@mbektas
Copy link
Member

mbektas commented Oct 28, 2023

I need to take a deeper look. I tested with the bundled Python environment in browser. Issue might be in the bundled environment. Let's keep it here still.

@mbektas
Copy link
Member

mbektas commented Oct 29, 2023

I took another look at this issue. It appears to be an issue with torch library itself or its interaction with other libraries in the Python environment. Not an issue with JupyterLab web app or desktop app. Because, it is reproducible in a python REPL, just by import torch. importing torch results in segmentation fault.

@JasonWeill
Copy link

@mbektas Thank you for the update! Because this can be reproduced with just the torch library, @roualdes, please open an issue in the Pytorch repo if you still see this error.

@roualdes
Copy link
Author

I have already moved on, so no need to leave this open as far as I'm concerned. I'll just add that I can not reproduce @mbektas' results. With Python 3.8.17 in JupyterLab.app 4.0.7-1 on MacOS 12.7 import torch restarts the kernel. While from a Python REPL (3.8.18 is as close as I could get to matching Python versions) import torch works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants