Data Loader Gets stuck when run on terminal, but runs when run through Pycharm

111232: <p>Data Loader Gets stuck when run on terminal, but runs when run through Pycharm.</p>
<p>If I run the script through the terminal, the data loader does not work but the cpu works in full load.</p>
<p>However, if I run the same script through the remote interpreter function of Pycharm, it works.<br>
In the terminal, if I put num_workers to 0 then it works. However with more than 1 worker, the data loader does not work.</p>
<p>Are there any known issues on this? It is strange since in the terminal it does not work and in a remote interpreter of Pycharm, it works.</p>
<p>The following is the output of “conda list”</p>
<h1>packages in environment at /home/jinwon/.conda/envs/raven_py3:</h1>
<h1></h1>
<h1>Name                    Version                   Build  Channel</h1>
<p>_libgcc_mutex             0.1                        main<br>
absl-py                   0.9.0                    py37_0<br>
attrs                     19.3.0                     py_0<br>
backcall                  0.1.0                    py37_0<br>
beautifulsoup4            4.8.2                    pypi_0    pypi<br>
blas                      1.0                         mkl<br>
bleach                    3.1.0                    py37_0<br>
c-ares                    1.15.0            h7b6447c_1001<br>
ca-certificates           2020.1.1                      0<br>
certifi                   2019.11.28               py37_0<br>
cloudpickle               1.3.0                      py_0<br>
cudatoolkit               10.1.243             h6bb024c_0<br>
cycler                    0.10.0                   py37_0<br>
cytoolz                   0.10.1           py37h7b6447c_0<br>
dask-core                 2.10.1                     py_0<br>
dbus                      1.13.12              h746ee38_0<br>
decorator                 4.4.1                      py_0<br>
defusedxml                0.6.0                      py_0<br>
entrypoints               0.3                      py37_0<br>
expat                     2.2.6                he6710b0_0<br>
fontconfig                2.13.0               h9420a91_0<br>
freetype                  2.9.1                h8a8886c_1<br>
glib                      2.63.1               h5a9c865_0<br>
gmp                       6.1.2                h6c8ec71_1<br>
grpcio                    1.16.1           py37hf8bcb03_1<br>
gst-plugins-base          1.14.0               hbbd80ab_1<br>
gstreamer                 1.14.0               hb453b48_1<br>
icu                       58.2                 h9c2bf20_1<br>
imageio                   2.6.1                    py37_0<br>
importlib_metadata        1.5.0                    py37_0<br>
intel-openmp              2020.0                      166<br>
ipykernel                 5.1.4            py37h39e3cac_0<br>
ipython                   7.12.0           py37h5ca1d4c_0<br>
ipython_genutils          0.2.0                    py37_0<br>
ipywidgets                7.5.1                      py_0<br>
jedi                      0.16.0                   py37_0<br>
jinja2                    2.11.1                     py_0<br>
jpeg                      9b                   h024ee3a_2<br>
jsonschema                3.2.0                    py37_0<br>
jupyter                   1.0.0                    py37_7<br>
jupyter_client            5.3.4                    py37_0<br>
jupyter_console           6.1.0                      py_0<br>
jupyter_core              4.6.1                    py37_0<br>
kiwisolver                1.1.0            py37he6710b0_0<br>
ld_impl_linux-64          2.33.1               h53a641e_7<br>
libedit                   3.1.20181209         hc058e9b_0<br>
libffi                    3.2.1                hd88cf55_4<br>
libgcc-ng                 9.1.0                hdf63c60_0<br>
libgfortran-ng            7.3.0                hdf63c60_0<br>
libpng                    1.6.37               hbc83047_0<br>
libprotobuf               3.11.3               hd408876_0<br>
libsodium                 1.0.16               h1bed415_0<br>
libstdcxx-ng              9.1.0                hdf63c60_0<br>
libtiff                   4.1.0                h2733197_0<br>
libuuid                   1.0.3                h1bed415_2<br>
libxcb                    1.13                 h1bed415_1<br>
libxml2                   2.9.9                hea5a465_1<br>
lxml                      4.5.0                    pypi_0    pypi<br>
markdown                  3.1.1                    py37_0<br>
markupsafe                1.1.1            py37h7b6447c_0<br>
matplotlib                3.1.3                    py37_0<br>
matplotlib-base           3.1.3            py37hef1b27d_0<br>
mistune                   0.8.4            py37h7b6447c_0<br>
mkl                       2020.0                      166<br>
mkl-service               2.3.0            py37he904b0f_0<br>
mkl_fft                   1.0.15           py37ha843d7b_0<br>
mkl_random                1.1.0            py37hd6b4f25_0<br>
nbconvert                 5.6.1                    py37_0<br>
nbformat                  5.0.4                      py_0<br>
ncurses                   6.1                  he6710b0_1<br>
networkx                  2.4                        py_0<br>
ninja                     1.9.0            py37hfd86e86_0<br>
notebook                  6.0.3                    py37_0<br>
numpy                     1.18.1           py37h4f9e942_0<br>
numpy-base                1.18.1           py37hde5b4d6_1<br>
olefile                   0.46                     py37_0<br>
openssl                   1.1.1d               h7b6447c_4<br>
pandas                    1.0.1            py37h0573a6f_0<br>
pandoc                    2.2.3.2                       0<br>
pandocfilters             1.4.2                    py37_1<br>
parso                     0.6.1                      py_0<br>
pcre                      8.43                 he6710b0_0<br>
pexpect                   4.8.0                    py37_0<br>
pickleshare               0.7.5                    py37_0<br>
pillow                    7.0.0            py37hb39fc2d_0<br>
pip                       20.0.2                   py37_1<br>
prometheus_client         0.7.1                      py_0<br>
prompt_toolkit            3.0.3                      py_0<br>
protobuf                  3.11.3           py37he6710b0_0<br>
ptyprocess                0.6.0                    py37_0<br>
pygments                  2.5.2                      py_0<br>
pyparsing                 2.4.6                      py_0<br>
pyqt                      5.9.2            py37h05f1152_2<br>
pyrsistent                0.15.7           py37h7b6447c_0<br>
python                    3.7.6                h0371630_2<br>
python-dateutil           2.8.1                      py_0<br>
pytorch                   1.4.0           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch<br>
pytz                      2019.3                     py_0<br>
pywavelets                1.1.1            py37h7b6447c_0<br>
pyzmq                     18.1.1           py37he6710b0_0<br>
qt                        5.9.7                h5867ecd_1<br>
qtconsole                 4.6.0                      py_1<br>
readline                  7.0                  h7b6447c_5<br>
scikit-image              0.16.2           py37h0573a6f_0<br>
scipy                     1.4.1            py37h0b6359f_0<br>
seaborn                   0.10.0                     py_0<br>
send2trash                1.5.0                    py37_0<br>
setuptools                45.2.0                   py37_0<br>
sip                       4.19.8           py37hf484d3e_0<br>
six                       1.14.0                   py37_0<br>
soupsieve                 2.0                      pypi_0    pypi<br>
sqlite                    3.31.1               h7b6447c_0<br>
tensorboard               2.0.0              pyhb38c66f_1<br>
terminado                 0.8.3                    py37_0<br>
testpath                  0.4.4                      py_0<br>
tk                        8.6.8                hbc83047_0<br>
toolz                     0.10.0                     py_0<br>
torchvision               0.5.0                py37_cu101    pytorch<br>
tornado                   6.0.3            py37h7b6447c_3<br>
tqdm                      4.42.1                     py_0<br>
traitlets                 4.3.3                    py37_0<br>
wcwidth                   0.1.8                      py_0<br>
webencodings              0.5.1                    py37_1<br>
werkzeug                  1.0.0                      py_0<br>
wheel                     0.34.2                   py37_0<br>
widgetsnbextension        3.5.1                    py37_0<br>
xz                        5.2.4                h14c3975_4<br>
zeromq                    4.3.1                he6710b0_3<br>
zipp                      2.2.0                      py_0<br>
zlib                      1.2.11               h7b6447c_3<br>
zstd                      1.3.7                h0b5b093_0</p>

erobic: <p>I have also had this bizarre issue and for some strange reason, it was related to importing <code>matplotlib</code> for me.</p>
<p>When <code>matplotlib.pyplot</code> is being imported, then setting num_workers &gt; 0 works with pycharm but gets stuck with bash script.</p>
<p>When I do not import <code>matplotlib</code>, then it works fine.</p>
<p>Not sure what is going on.</p>