Install the dev version of Theano. It contains segmentation fault fixes. If that don't work, tell us, but I think it should work.
Le ven. 30 juin 2017 06:00, noodles <[email protected]> a écrit : > Hello, > > I encounter a strange problem when using theano. These days I bought > a new computer and install theano on it, and I can even import it in > python with no error, but everytime I create a function, it corrupted with > "Segmentation > fault(core dumped)". Below is the detail: > I have installed theano on another two old machine, and they works > well. > This new machine is : CPU: intel 7700; GPU 2xGTX1080Ti, OS: ubuntu16.04. > CUDA 8.0, cudnn 5.1 .I use miniconda2 to install theano( conda install > theano), python 2.7, theano 0.9.0 > > when I import theano in python, the output is: > >> *nice@fat01:~$ python* >> *Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, >> 23:09:15) * >> *[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2* >> *Type "help", "copyright", "credits" or "license" for more information.* >> *Anaconda is brought to you by Continuum Analytics.* >> *Please check out: http://continuum.io/thanks <http://continuum.io/thanks >> > >> and https://anaconda.org <https://anaconda.org>* >> *>>> import theano* >> *Using cuDNN version 5110 on context None* >> *Mapped name None to device cuda1: GeForce GTX 1080 Ti (0000:02:00.0)* >> *>>> * > > > then I input the code from the exercise of > http://deeplearning.net/software/theano/tutorial/using_gpu.html#gpuarray > > ================================================================================ > > *import numpy* > *import theano* > *import theano.tensor as T* > *rng = numpy.random* > *N = 400* > *feats = 784* > *D = (rng.randn(N, feats).astype(theano.config.floatX),* > *rng.randint(size=N,low=0, high=2).astype(theano.config.floatX))* > *training_steps = 10000* > *# Declare Theano symbolic variables* > *x = T.matrix("x")* > *y = T.vector("y")* > *w = theano.shared(rng.randn(feats).astype(theano.config.floatX), > name="w")* > *b = theano.shared(numpy.asarray(0., dtype=theano.config.floatX), > name="b")* > *x.tag.test_value = D[0]* > *y.tag.test_value = D[1]* > *# Construct Theano expression graph* > *p_1 = 1 / (1 + T.exp(-T.dot(x, w)-b)) # Probability of having a one* > *prediction = p_1 > 0.5 # The prediction that is done: 0 or 1* > *xent = -y*T.log(p_1) - (1-y)*T.log(1-p_1) # Cross-entropy* > *cost = xent.mean() + 0.01*(w**2).sum() # The cost to optimize* > *gw,gb = T.grad(cost, [w,b])* > *# Compile expressions to functions* > *train = theano.function(* > * inputs=[x,y],* > * outputs=[prediction, xent],* > * updates=[(w, w-0.01*gw), (b, b-0.01*gb)],* > * name = "train")* > > > ============================================================================== > It corrupted at this line. > I have run numpy.test() and scipy.test() and they work well, but when I > run theano.test(), it corrupted too. The full log is too long, so I just > post > the end of it: > > */home/nice/miniconda2/lib/python2.7/site-packages/ >> theano/compile/nanguardmode.py:168: >> RuntimeWarning: All-NaN axis encountered* >> * return np.isinf(np.nanmax(arr)) or np.isinf(np.nanmin(arr))* >> *.E......................................../home/nice/ >> miniconda2/lib/python2.7/site-packages/theano/gof/vm.py:851: >> UserWarning: CVM does not support memory profile, using Stack VM.* >> * 'CVM does not support memory profile, using Stack VM.')* >> *...........SS.............0.930614401665* >> *0.930614401665* >> *0.930614401665* >> *0.930614401665* >> *........................................................... >> ............................................................ >> ...................................E/home/nice/miniconda2/ >> lib/python2.7/site-packages/theano/gof/vm.py:854: >> UserWarning: LoopGC does not support partial evaluation, using Stack VM.* >> * 'LoopGC does not support partial evaluation, '* >> *.....EEEESegmentation fault (core dumped)* > > > > I hope someone can help me. > > -- > > --- > You received this message because you are subscribed to the Google Groups > "theano-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
