Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

Error running example given in "Quick start"

Open sidgoyal78 opened this issue 8 years ago • 3 comments

I basically followed the steps given here (inside a virtual environment): https://github.com/PaddlePaddle/Paddle/blob/develop/doc/getstarted/index_en.rst

  1. I used pip to install: pip install paddlepaddle
  2. Then I started running the "housing" example line by line in Python interpreter, and get the following error:
>>> import paddle.v2 as paddle
>>> paddle.init(use_gpu = False, train_count = 1)
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

sidgoyal78 avatar Dec 14 '17 21:12 sidgoyal78

When I run the program with "-v" option (as in python -v housing.py): I get the following log (truncated):

.
.
.
# /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/inference.pyc matches /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/inference.py
import paddle.v2.inference # precompiled from /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/inference.pyc
# /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/minibatch.pyc matches /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/minibatch.py
import paddle.v2.minibatch # precompiled from /Users/goyalsiddharth/pad/lib/python2.7/site-packages/paddle/v2/minibatch.pyc
import py_paddle # directory /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle
# /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/__init__.pyc matches /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/__init__.py
import py_paddle # precompiled from /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/__init__.pyc
# /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/util.pyc matches /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/util.py
import py_paddle.util # precompiled from /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/util.pyc
# /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/swig_paddle.pyc matches /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/swig_paddle.py
import py_paddle.swig_paddle # precompiled from /Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/swig_paddle.pyc
dlopen("/Users/goyalsiddharth/pad/lib/python2.7/site-packages/py_paddle/_swig_paddle.so", 2);
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

Maybe this suggests issues with _swig_paddle.so ?

sidgoyal78 avatar Dec 14 '17 21:12 sidgoyal78

I think this problem arises (at least for me) if I use python from anaconda. When switching back to default python in the system, I get paddle working, and also this example is running ~with a minor modification:~ Line 2: paddle.init(use_gpu = False, trainer_count = 1)

sidgoyal78 avatar Jan 04 '18 20:01 sidgoyal78

@sidgoyal78 line2: paddle.init(use_gpu=False, trainer_count=1) trainer_count not train_count

luotao1 avatar Jan 05 '18 01:01 luotao1