[theano-users] Re: theano error message: Optimization failure due to: LocalOptGroup(use_c_ger,use_c_gemv) on Mac El Capitan
By the way, if it helps, I installed Theano using the command on the Lasagne docs: http://lasagne.readthedocs.io/en/latest/user/installation.html#bleeding-edge-version Which was: pip install --upgrade https://github.com/Theano/Theano/archive/master.zip -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[theano-users] Re: theano error message: Optimization failure due to: LocalOptGroup(use_c_ger,use_c_gemv) on Mac El Capitan
I should also add, in case it helps, I installed Theano (and Lasagne) using the two commands here: http://lasagne.readthedocs.io/en/latest/user/installation.html#bleeding-edge-version on the Lasagne documentation. On Tuesday, November 22, 2016 at 9:38:34 PM UTC-8, Daniel Seita wrote: > > Hi all, > > I am attempting to follow the logistic regression example in the > documentation. Here is a subset of the code that people with correct theano > versions should be able to run: > > import numpy > > import theano > > import theano.tensor as T > > rng = numpy.random > > > N = 400 > > feats = 784 > > > # generate a dataset: D = (input_values, target_class) > > D = (rng.randn(N, feats), rng.randint(size=N, low=0, high=2)) > > training_steps = 1 > > > # Declare Theano symbolic variables > > x = T.dmatrix("x") > > y = T.dvector("y") > > > # initialize the weight vector w randomly this and the following bias > variable b > > # are shared so they keep their values between training iterations > (updates) > > w = theano.shared(rng.randn(feats), name="w") > > b = theano.shared(0., name="b") > > > # Construct Theano expression graph > > p_1 = 1 / (1 + T.exp(-T.dot(x, w) - b)) > > prediction = p_1 > 0.5 > > xent = -y * T.log(p_1) - (1-y) * T.log(1-p_1) # Cross-entropy loss > function > > cost = xent.mean() + 0.01 * (w ** 2).sum() # The cost to minimize > (w/regularization!) > > gw, gb = T.grad(cost, [w, b]) # Compute gradient of cost > wrt w and b. > > > predict = theano.function( > > inputs=[x], > > outputs=[prediction] > > ) > > When running the above, I get the following error: > > ERROR (theano.gof.opt): Optimization failure due to: > LocalOptGroup(use_c_ger,use_c_gemv) > > ERROR (theano.gof.opt): node: > Gemv{no_inplace}(AllocEmpty{dtype='float64'}.0, TensorConstant{1.0}, x, w, > TensorConstant{0.0}) > > ERROR (theano.gof.opt): TRACEBACK: > > ERROR (theano.gof.opt): Traceback (most recent call last): > > File > "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/gof/opt.py", > line 1922, in process_node > > replacements = lopt.transform(node) > > File > "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/gof/opt.py", > line 1309, in transform > > new_repl = opt.transform(node) > > File > "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/tensor/blas_c.py", > > line 674, in use_c_gemv > > if not config.blas.ldflags: > > File > "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/configparser.py", > > line 328, in __get__ > > val_str = self.default() > > File > "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/configdefaults.py", > > line 1258, in default_blas_ldflags > > lib_path = blas_info.get('library_dirs', [])[0] > > IndexError: list index out of range > > Note that if I don't include the predict function in the code above, it > will work (i.e. the problem is with the function). The error message seems > to be related to blas (?) but I'm not sure how to fix it. I noticed > something similar here: > https://groups.google.com/forum/#!topic/theano-users/Lv-tmIOYqR4 > > But that is with Python 3.4. I am using Python 2.7. In addition, what I > don't understand is that I can actually run functions from the Theano > documentation! Here's an example. I'm following the tutorial on "copying > functions" but this was chosen purely as an example. I run the following > lines: > > Python 2.7.12 |Anaconda 4.2.0 (x86_64)| (default, Jul 2 2016, 17:43:17) > > Type "copyright", "credits" or "license" for more information. > > > IPython 5.1.0 -- An enhanced Interactive Python. > > ? -> Introduction and overview of IPython's features. > > %quickref -> Quick reference. > > help -> Python's own help system. > > object? -> Details about 'object', use 'object??' for extra details. > > > In [*1*]: *import* *theano* > > > In [*2*]: *import* *theano.tensor* *as* *T* > > > In [*3*]: state = theano.shared(0) > > > In [*4*]: inc = T.iscalar('inc') > > > In [*5*]: accumulator = theano.function([inc], state, updates=[(state, > state+inc)]) > > > In [*6*]: accumulator(10) > > Out[*6*]: array(0) > > > In [*7*]: *print*(state.get_value()) > > 10 > > Everything looks good! So I don't know why I can run some functions here > but not others. Any advice would be appreciated. > > Additional details: > > This is run on a Mac laptop, version 10.11.16 El Capitan > > My .theanorc file in the home directory: > > [global] > > floatX = float32 > > ddevice = cpu > > I am NOT using a GPU, though my laptop has one (I just choose not to use > it out of simplicity for now). Here is my theano version: > > In [*1*]: *import* *theano* > > > In [*2*]: theano.__version__ > > Out[*2*]: '0.9.0dev4.dev-RELEASE' > > Let me know if there's any other information that would be helpful. > > > -- --- You received this message because you are subscribed to the Google Groups "theano-users"
[theano-users] theano error message: Optimization failure due to: LocalOptGroup(use_c_ger,use_c_gemv) on Mac El Capitan
Hi all, I am attempting to follow the logistic regression example in the documentation. Here is a subset of the code that people with correct theano versions should be able to run: import numpy import theano import theano.tensor as T rng = numpy.random N = 400 feats = 784 # generate a dataset: D = (input_values, target_class) D = (rng.randn(N, feats), rng.randint(size=N, low=0, high=2)) training_steps = 1 # Declare Theano symbolic variables x = T.dmatrix("x") y = T.dvector("y") # initialize the weight vector w randomly this and the following bias variable b # are shared so they keep their values between training iterations (updates) w = theano.shared(rng.randn(feats), name="w") b = theano.shared(0., name="b") # Construct Theano expression graph p_1 = 1 / (1 + T.exp(-T.dot(x, w) - b)) prediction = p_1 > 0.5 xent = -y * T.log(p_1) - (1-y) * T.log(1-p_1) # Cross-entropy loss function cost = xent.mean() + 0.01 * (w ** 2).sum() # The cost to minimize (w/regularization!) gw, gb = T.grad(cost, [w, b]) # Compute gradient of cost wrt w and b. predict = theano.function( inputs=[x], outputs=[prediction] ) When running the above, I get the following error: ERROR (theano.gof.opt): Optimization failure due to: LocalOptGroup(use_c_ger,use_c_gemv) ERROR (theano.gof.opt): node: Gemv{no_inplace}(AllocEmpty{dtype='float64'}.0, TensorConstant{1.0}, x, w, TensorConstant{0.0}) ERROR (theano.gof.opt): TRACEBACK: ERROR (theano.gof.opt): Traceback (most recent call last): File "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/gof/opt.py", line 1922, in process_node replacements = lopt.transform(node) File "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/gof/opt.py", line 1309, in transform new_repl = opt.transform(node) File "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/tensor/blas_c.py", line 674, in use_c_gemv if not config.blas.ldflags: File "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/configparser.py", line 328, in __get__ val_str = self.default() File "/Users/danielseita/anaconda2/lib/python2.7/site-packages/theano/configdefaults.py", line 1258, in default_blas_ldflags lib_path = blas_info.get('library_dirs', [])[0] IndexError: list index out of range Note that if I don't include the predict function in the code above, it will work (i.e. the problem is with the function). The error message seems to be related to blas (?) but I'm not sure how to fix it. I noticed something similar here: https://groups.google.com/forum/#!topic/theano-users/Lv-tmIOYqR4 But that is with Python 3.4. I am using Python 2.7. In addition, what I don't understand is that I can actually run functions from the Theano documentation! Here's an example. I'm following the tutorial on "copying functions" but this was chosen purely as an example. I run the following lines: Python 2.7.12 |Anaconda 4.2.0 (x86_64)| (default, Jul 2 2016, 17:43:17) Type "copyright", "credits" or "license" for more information. IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [*1*]: *import* *theano* In [*2*]: *import* *theano.tensor* *as* *T* In [*3*]: state = theano.shared(0) In [*4*]: inc = T.iscalar('inc') In [*5*]: accumulator = theano.function([inc], state, updates=[(state, state+inc)]) In [*6*]: accumulator(10) Out[*6*]: array(0) In [*7*]: *print*(state.get_value()) 10 Everything looks good! So I don't know why I can run some functions here but not others. Any advice would be appreciated. Additional details: This is run on a Mac laptop, version 10.11.16 El Capitan My .theanorc file in the home directory: [global] floatX = float32 ddevice = cpu I am NOT using a GPU, though my laptop has one (I just choose not to use it out of simplicity for now). Here is my theano version: In [*1*]: *import* *theano* In [*2*]: theano.__version__ Out[*2*]: '0.9.0dev4.dev-RELEASE' Let me know if there's any other information that would be helpful. -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [theano-users] which function in theano implement numpy.where?
Hi, The only syntax we currently support in tensor.where is the one where two additional argument are provided, like in: >>> numpy.where(a > 3, a, a + 3) array([3, 4, 5, 6, 4, 5, 6, 7, 8, 9]) >>> x = tensor.vector() >>> tensor.where(x > 3, x, x + 3).eval({x: a}) array([ 3., 4., 5., 6., 4., 5., 6., 7., 8., 9.]) If you want to reproduce the behaviour when only the condition is provided, you can do that with nonzero: >>> out, = tensor.nonzero(x > 3) >>> out.eval({x: a}) array([4, 5, 6, 7, 8, 9]) Note that Theano will return a tuple of 1 array if x.ndim == 1, whereas numpy returns a single array. If you are interested in making the "nonzero" feature available from "tensor.where", please let us know. On Tue, Nov 22, 2016, linzhesha...@gmail.com wrote: > Dear all, > I wanna to use np.where in theano. However, it seems that > theano.tensor.where is not doing the same things as numpy.where will do. Is > there any function i can use in theano? > For example, > > a = numpy.arange(10) > index = numpy.where(a>a[0]) > > How to implement the code above in theano? > > -- > > --- > 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 theano-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Pascal -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [theano-users] nvcc compiler not found on $PATH but I can run nvcc -V
look in pycharm doc. It probably tell how to change it. But if it is a real shell, you could manually do in each shell: PATH=... with ... be what you want as PATH. On Tue, Nov 22, 2016 at 4:16 PM, 王烨wrote: > Hi, > Thanks for you reply. > I tried in terminal : > ye@ye-desktop:~/Dropbox/PycharmProjects/project$ echo $PATH > /usr/local/cuda-8.0/bin:/usr/local/cuda-8.0/bin:/home/ye/ > bin:/home/ye/.local/bin:/usr/local/sbin:/usr/local/bin:/ > usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/ > snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java- > 8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin > > while in Pycharm : > print 'PATH:', os.environ['PATH'] > PATH: /home/ye/bin:/home/ye/.local/bin:/usr/local/sbin:/usr/ > local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/ > local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/ > usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin > > But in Pycharm, shell path, it shows: /bin/bash > what should I change to ? > > Thanks again. > > > 在 2016年11月20日星期日 UTC-6下午6:35:47,Pascal Lamblin写道: >> >> Pycharm is probably setting its environment in a particular way. >> >> You can probably check what is in os.environ['PATH'] from Pycharm, and >> compare with what "echo $PATH" return in the shell. >> >> On Sun, Nov 20, 2016, 王烨 wrote: >> > Dear folks: >> > I recently met a question. >> > >> > I think I did set everything all right in theano. because when I import >> my >> > theano in python terminal, it shows: >> > Python 2.7.12 (default, Jul 1 2016, 15:12:24) >> > [GCC 5.4.0 20160609] on linux2 >> > Type "help", "copyright", "credits" or "license" for more information. >> > >>> import theano >> > Using gpu device 0: GeForce GTX 1060 6GB (CNMeM is enabled with initial >> > size: 80.0% of memory, cuDNN 5105) >> > >> > >> > When I run nvcc -C , it shows: >> > ye@ye-desktop:/home$ nvcc -V >> > nvcc: NVIDIA (R) Cuda compiler driver >> > Copyright (c) 2005-2016 NVIDIA Corporation >> > Built on Sun_Sep__4_22:14:01_CDT_2016 >> > Cuda compilation tools, release 8.0, V8.0.44 >> > >> > >> > But when I try to use gensim and theano in Pycharm, It shows: >> > ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check >> your >> > nvcc installation and try again. >> > >> > Any suggestions? >> > >> > -- >> > >> > --- >> > 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 theano-users...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. >> >> >> -- >> Pascal >> > -- > > --- > 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 theano-users+unsubscr...@googlegroups.com. > 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [theano-users] nvcc compiler not found on $PATH but I can run nvcc -V
Hi, Thanks for you reply. I tried in terminal : ye@ye-desktop:~/Dropbox/PycharmProjects/project$ echo $PATH /usr/local/cuda-8.0/bin:/usr/local/cuda-8.0/bin:/home/ye/bin:/home/ye/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin while in Pycharm : print 'PATH:', os.environ['PATH'] PATH: /home/ye/bin:/home/ye/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin But in Pycharm, shell path, it shows: /bin/bash what should I change to ? Thanks again. 在 2016年11月20日星期日 UTC-6下午6:35:47,Pascal Lamblin写道: > > Pycharm is probably setting its environment in a particular way. > > You can probably check what is in os.environ['PATH'] from Pycharm, and > compare with what "echo $PATH" return in the shell. > > On Sun, Nov 20, 2016, 王烨 wrote: > > Dear folks: > > I recently met a question. > > > > I think I did set everything all right in theano. because when I import > my > > theano in python terminal, it shows: > > Python 2.7.12 (default, Jul 1 2016, 15:12:24) > > [GCC 5.4.0 20160609] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import theano > > Using gpu device 0: GeForce GTX 1060 6GB (CNMeM is enabled with initial > > size: 80.0% of memory, cuDNN 5105) > > > > > > When I run nvcc -C , it shows: > > ye@ye-desktop:/home$ nvcc -V > > nvcc: NVIDIA (R) Cuda compiler driver > > Copyright (c) 2005-2016 NVIDIA Corporation > > Built on Sun_Sep__4_22:14:01_CDT_2016 > > Cuda compilation tools, release 8.0, V8.0.44 > > > > > > But when I try to use gensim and theano in Pycharm, It shows: > > ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check > your > > nvcc installation and try again. > > > > Any suggestions? > > > > -- > > > > --- > > 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 theano-users...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > > > -- > Pascal > -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[theano-users] Re: normalization code in CNN?
Could be used CrossChannelNormalization of pylearn as a local response normalization? Regards. El martes, 22 de noviembre de 2016, 16:15:08 (UTC+1), Beatriz G. escribió: > > Hi. > > I have the same problem. > > Anyone could help me? > > El miércoles, 30 de julio de 2014, 5:44:54 (UTC+2), xu shen escribió: >> >> Does anyone have the normalization code for LeNetPoolLayer? >> >> The convolution layer is defined as follows: >> Class LeNetConvPoolLayer(object): >> >> conv_out=conv.conv2d(input=input, filters=self.W, >> image_shape=image_shape,filter_shape=filter_shape, subsample = subsampe) >> >> norm_out = normalizer(conv_out,k,n,alpha,beta)# I want to do >> normalization here just as Alex Krizhevsky does in DCNN, but I can not find >> proper code to do this in theano. >> >> pooled_out = >> downsample.max_pool_2d(input=norm_out,ds=poolsize,ignore_border=True) >> >> I found out that it's hard to incorporate CrossChannelNormalization in >> pylearn2.expr.normalize for this task... >> can any one share your normalization theano code in CNN or how to use >> CrossChannelNormalizaiton in this code? >> Thanks very much. >> > -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[theano-users] GPU is not available in Theano
Hi, I have constructed the environment as below. CUDA is working well in Visual Studio. However, I cannot use GPU well in Theano using simple test code. OS: Windows 10 Home 64bit GPU: GTX 1080 Visual Studio: Visual Studio 2015 CUDA: CUDA 8.0 & cuDNN 5.1 DNN framework: Theano Error message is "WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavailable)". How to change the settings? Regards -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[theano-users] Re: normalization code in CNN?
Hi. I have the same problem. Anyone could help me? El miércoles, 30 de julio de 2014, 5:44:54 (UTC+2), xu shen escribió: > > Does anyone have the normalization code for LeNetPoolLayer? > > The convolution layer is defined as follows: > Class LeNetConvPoolLayer(object): > > conv_out=conv.conv2d(input=input, filters=self.W, > image_shape=image_shape,filter_shape=filter_shape, subsample = subsampe) > > norm_out = normalizer(conv_out,k,n,alpha,beta)# I want to do > normalization here just as Alex Krizhevsky does in DCNN, but I can not find > proper code to do this in theano. > > pooled_out = > downsample.max_pool_2d(input=norm_out,ds=poolsize,ignore_border=True) > > I found out that it's hard to incorporate CrossChannelNormalization in > pylearn2.expr.normalize for this task... > can any one share your normalization theano code in CNN or how to use > CrossChannelNormalizaiton in this code? > Thanks very much. > -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[theano-users] which function in theano implement numpy.where?
Dear all, I wanna to use np.where in theano. However, it seems that theano.tensor.where is not doing the same things as numpy.where will do. Is there any function i can use in theano? For example, a = numpy.arange(10) index = numpy.where(a>a[0]) How to implement the code above in theano? -- --- 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 theano-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.