Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Windows: Python prompt gets stuck on exit() #9271

Open
nehaljwani opened this issue Jan 1, 2018 · 14 comments
Open

Windows: Python prompt gets stuck on exit() #9271

nehaljwani opened this issue Jan 1, 2018 · 14 comments

Comments

@nehaljwani
Copy link
Contributor

nehaljwani commented Jan 1, 2018

Description

Python prompt gets stuck on exit() after importing mxnet

Environment info (Required)

(mxnetpypi) F:\nwani>python sources\im\tools\diagnose.py
----------Python Info----------
Version      : 3.6.3
Compiler     : MSC v.1900 64 bit (AMD64)
Build        : ('default', 'Nov  8 2017 15:10:56')
Arch         : ('64bit', 'WindowsPE')
------------Pip Info-----------
Version      : 9.0.1
Directory    : F:\nwani\mc3\envs\mxnetpypi\lib\site-packages\pip
----------MXNet Info-----------
Version      : 1.0.0
Directory    : F:\nwani\mc3\envs\mxnetpypi\lib\site-packages\mxnet
Commit Hash   : 0f05c65492e38f89012e5595c6d60bb67e2d418f
----------System Info----------
Platform     : Windows-7-6.1.7601-SP1
system       : Windows
node         : xxxxx-win64-gpu
release      : 7
version      : 6.1.7601
----------Hardware Info----------
machine      : AMD64
processor    : Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
Name
Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz

----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0156 sec, LOAD: 1.2012 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.2652 sec, LOAD: 0.0780 sec.
Error open Gluon Tutorial(cn): https://zh.gluon.ai, <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>, DNS finis
hed in 0.2652003765106201 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.062
4 sec, LOAD: 0.4368 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0312 sec, LOAD: 0.1872 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0000 sec, LOAD: 0.1872 sec.
...gets stuck here, I have to end the process python.exe

Package used (Python/R/Scala/Julia):

(mxnetpypi) F:\nwani>python -V
Python 3.6.3 :: Anaconda, Inc.

Minimum reproducible example

(base) F:\nwani> conda create -yn mxnetpypi python pip
(base) F:\nwani> conda activate mxnetpypi
(mxnetpypi) F:\nwani>pip install mxnet --no-cache-dir
(mxnetpypi) F:\nwani>python
Python 3.6.3 |Anaconda, Inc.| (default, Nov  8 2017, 15:10:56) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet
>>> exit()
...gets stuck here, I have to end the process python.exe
@nehaljwani
Copy link
Contributor Author

nehaljwani commented Jan 1, 2018

EDIT This doesn't work for all cases

If I comment out

atexit.register(_notify_shutdown)

at https://github.com/apache/incubator-mxnet/blob/1.0.0/python/mxnet/base.py#L394 the problem goes away. Of course, that's just a workaround.

@nehaljwani
Copy link
Contributor Author

Additional findings:

  • So far reproducible only on Windows 7. Windows 10 doesn't face this issue.
  • This problem isn't specific to Anaconda Python. I tried with the installer from https://www.python.org/downloads/ too. Same problem.

@rf987
Copy link

rf987 commented Jan 7, 2018

+1

I'm having the same issue on Windows 7, running mxnet '0.11.0'
I have to manually kill the python process whenever I create a model or even load a model from checkpoint.

@freshcoderman
Copy link

+1
same issue on Windows7, running mxnet '1.0.0' with both python2 and python3 as long as I do "import mxnet as mx"

@TinkerSteve
Copy link

TinkerSteve commented Feb 27, 2018

+1
win7 64bit python 3.5.4
mxnet.version = '1.0.0'

actually one more information that might help:

If I open the properties dialog of the blocked python process in SysInternals Process Explorer and activate the "Threads" Tab ... the process finishes immediately.

Commenting
atexit.register(_notify_shutdown)
does not prevent the issue on my side

@marcoabreu
Copy link
Contributor

Possibly related to #8921

@rf987
Copy link

rf987 commented Jun 19, 2018

+1 . any updates on this? This one bug is making our team consider migrating to TensorFlow

@srochel
Copy link
Contributor

srochel commented Jun 26, 2018

@rf987 - we are investigating. We think we found the root cause and are discussing potential resolution.

@vandanavk
Copy link
Contributor

is there a fix for this issue? would be great to verify it against #8921 too.

@yuanjunyi
Copy link

I have the same issue on win7 with mxnet 1.2.0 and python 3.6.6.

@zhangyichent
Copy link

zhangyichent commented Aug 28, 2018

+1 win7+anaconda python3.6.5 +mxnet(cpu)

@caigen
Copy link

caigen commented Sep 18, 2019

+1. win7 + python 3.7 + pip mxnet.

@B5paper
Copy link

B5paper commented Nov 18, 2019

+1. win7 + python3.7 + miniconda + pip + mxnet-cu92==1.5.0

@gmx1992
Copy link

gmx1992 commented Dec 4, 2020

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

No branches or pull requests