theano

Windows Theano Keras - lazylinker_ext\mod.cpp: No such file or directory

こ雲淡風輕ζ 提交于 2019-12-12 03:15:03
问题 I am installing Theano and Keras follwing the How do I install Keras and Theano in Anaconda Python on Windows?, which worked fine for me with an older release before. Now I have upgraded to the latest Theano version and when validating its functionality using this command: Python: from theano import function, config, shared, sandbox it resulted in really long error log containing: g++.exe: error: C:\Users\John: No such file or directory g++.exe: error: Dow\AppData\Local\Theano\compiledir

Theano crashing on import python3.4

一世执手 提交于 2019-12-12 03:09:25
问题 I've installed Theano 0.8.2 on my windows 10 laptop as per the documentation on their website for python3.4 users. The install of the dependencies and the theano package itself was successful, and all of them are up to date via pip. When I try to import theano however it produces a very large error I am unfamiliar with. Prefacing the error is just over 1000 lines of what appears to be code that is printed to the terminal. This question seems highly relevant, but I don't understand the answer

What is the theano counterpart of numpy apply_along_axis?

风格不统一 提交于 2019-12-12 02:39:42
问题 I want to apply some function to a tensor with Theano. Here's my numpy version script. But, I'm lost when converting this to a Theano version. For example, I want to convert array([[[0, 0, 1, 2, 3], [0, 1, 2, 3, 4]]]) to array([[[0, 0, 3, 2, 1], [0, 4, 3, 2, 1]]]) My numpy script is as follows: def reverse_and_shift(vec): ''' Returns reversed array of the given vector except the leading 0's. vec: 1-d array. >>> reverse_and_shift(np.array([0,0,1,2,3])) array([0, 0, 3, 2, 1]) ''' reversed = vec

[Theano]How to evaluate gradient based on shared variables

你说的曾经没有我的故事 提交于 2019-12-12 02:32:54
问题 I'm currently facing this issue: I can't manage to evaluate my gradient symbolic variables in a Recurrent Neural Network coded with Theano. Here's the code : W_x = theano.shared(init_W_x, name='W_x') W_h = theano.shared(init_W_h, name='W_h') W_y = theano.shared(init_W_y, name='W_y') [self.y, self.h], _ = theano.scan(self.step, sequences=self.x, outputs_info=[None, self.h0]) error = ((self.y - self.t) ** 2).sum() gW_x, gW_y, gW_h = T.grad(self.error, [W_x, W_h, W_y]) [...] def step(self, x_t,

theano.test() fails with nvcc error - nvcc fatal : Don't know what to do with 'NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC'

可紊 提交于 2019-12-12 02:23:46
问题 I'm installing Theano into an Ananconda environment and seem to have run into an install issue I don't understand. After I create the environment I run theano.test() and get the following error: ERROR:theano.sandbox.cuda:Failed to compile cuda_ndarray.cu: ('nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -m64 -Xcompiler -DCUDA_NDARRAY_CUH=m11b90075e2397c684f9dc0f7276eab8f,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC -Xlinker -rpath,/home/brad/.theano/compiledir_Linux-4.4--generic

What does negative log likelihood of logistic regression in theano look like?

社会主义新天地 提交于 2019-12-12 02:15:17
问题 I have been reading the theano's logistic regression tutorial. I was trying to understand how the negative log likelihood is calculated. y = ivector('y') W = dmatrix('W') b = dvector('b') input = dmatrix('inp') p_y_given_x = T.nnet.softmax(T.dot(input, W) + b) logs = T.log(self.p_y_given_x)[T.arange(y.shape[0]), y] On pretty printing printing theano.printing.pprint(logs) it returned 'AdvancedSubtensor(log(Softmax(x)), ARange(TensorConstant{0}, Constant{0}[Shape(y)], TensorConstant{1}), y)'

Theano error deep learning python

自闭症网瘾萝莉.ら 提交于 2019-12-11 15:16:37
问题 This is fairly standard openCV code where a loop will detect faces with haar cascade classifier and then there is a deep learning model that will detect the emotion in the face. The model was created from the 2013 kaggle dataset, and I downloaded this model from this github account if someone wants to try out the code. fer2013_mini_XCEPTION.119-0.65.hdf5 Just place a models folder in your directory and rename it to model.h5 https://github.com/oarriaga/face_classification/tree/master/trained

How to change Python default compiler to GCC?

*爱你&永不变心* 提交于 2019-12-11 13:24:36
问题 I have Windows 10 and Python 2.7 installed. When I run IDLE I find this: Python 2.7.10 (default, Oct 14 2015, 16:09:02) [MSC v.1500 32 bit (Intel)] I want the default compiler here to be MinGW's GCC (I already installed MinGW) becaue I cannot import Theano with the MSC compiler I tried all the tutorials out there and every time I successfully install Theano but when I try to import it I get the error "Problem occurred during compilation with the command line below:" and I get a huge list of

theano grad computation “illegally returned an integer-valued variable.”

为君一笑 提交于 2019-12-11 13:02:49
问题 I am computing a tensor which is a complex number, but then I take its magnitude and cast it as float32 : x = theano.tensor.abs_(cum).astype(theano.config.floatX) When I am trying to compute a cost function, I get the following error: TypeError: Elemwise{abs_,no_inplace}.grad (Input index 0, dtype complex128) I have no idea why this is happening.Any help would be really appreciated! 回答1: Apparently as long as any complex number computation is done in Theano, this problem arises, doesn't

Creating square matrix with eigenvalues on the diagonal in theano

孤街浪徒 提交于 2019-12-11 10:29:53
问题 I would like to create a square matrix with the eigenvalues on the diagonal: eigen_values, eigen_vectors = theano.tensor.nlinalg.eig(covariance_matrix) D = T.nlinalg.AllocDiag(eigen_values) However apparently theano does not treat the D matrix I created as a standard matrix, thus I cannot use it in the succeding computations. theano.tensor.var.AsTensorError: ('Cannot convert <theano.tensor.nlinalg.AllocDiag object at 0x7face5708450> to TensorType', <class 'theano.tensor.nlinalg.AllocDiag'>)