theano

Getting ImportError while importing keras

别等时光非礼了梦想. 提交于 2020-01-05 07:15:16
问题 I have followed every step for installing keras but whenever I am trying to import keras it gives me an error No module named tensorflow. But I have already installed tensorflow. I have two questions- 1. How can I solve this particular ImportError? 2. If possible can anyone give me a detailed step by step instruction on installing theano, tensorflow and keras? Please don't give any links to install keras because i have tried them all but they keep giving some kind of error or problem. If

regarding setting up GPU for theano

无人久伴 提交于 2020-01-05 05:44:08
问题 I configure the GPU under home/.theanorc as follows bash-4.1$ cat .theanorc [global] floatX = float32 device = gpu0 [lib] cnmem = 1 Running the program gives the following warning message, how to solve this problem? python train.py Using Theano backend. WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL: https://github.com/Theano

Theano: implementing an integral function

∥☆過路亽.° 提交于 2020-01-05 04:41:08
问题 I am trying to implement this function in theano. This is not about solving the integral (which is immediate) but rather how to implement it. So far I have gotten this import theano from theano import tensor as T import numpy as np import scipy.integrate as integrate x = T.vector('x') h = T.vector('h') t = T.scalar('t') A = np.asarray([[0,1],[1,0]]) A = theano.shared(name='A', value=A) B = np.asarray([[-1,0],[0,-1]]) B = theano.shared(name='B', value=B) xn = A.dot(x) hn = B.dot(h) res = (t +

AttributeError: 'Sequential' object has no attribute '_feed_input_names' in Keras Theano

纵然是瞬间 提交于 2020-01-04 14:19:49
问题 While executing the statement, hist = model.fit(X_train, Y_train, batch_size=batch_size, epochs=nb_epoch, verbose=1, validation_data=(X_test, Y_test)) I'm getting the error, File "C:\Users\Parag\Anaconda3\envs\keras_theano\lib\site-packages\keras\engine\training.py", line 737, in _standardize_user_data feed_input_names = self._feed_input_names AttributeError: 'Sequential' object has no attribute '_feed_input_names' 回答1: Try adding the input_shape argument to the first layer in your network.

numpy.matmul in Theano

强颜欢笑 提交于 2020-01-04 09:38:15
问题 TL;DR I want to replicate the functionality of numpy.matmul in theano . What's the best way to do this? Too Short; Didn't Understand Looking at theano.tensor.dot and theano.tensor.tensordot , I'm not seeing an easy way to do a straightforward batch matrix multiplication. i.e. treat the last two dimensions of N dimensional tensors as matrices, and multiply them. Do I need to resort to some goofy usage of theano.tensor.batched_dot ? Or *shudder* loop them myself without broadcasting!? 回答1: The

Theano Dimshuffle equivalent in Google's TensorFlow?

时间秒杀一切 提交于 2020-01-03 08:42:16
问题 I have seen that transpose and reshape together can help but I don't know how to use. Eg. dimshuffle(0, 'x') What is its equivalent by using transpose and reshape? or is there a better way? Thank you. 回答1: There are three relevant ops for implementing Theano's dimshuffle in TensorFlow: tf.transpose() is used to permute the dimensions of a tensor. If the pattern specified in the arguments to dimshuffle is a permutation of the input tensor's dimensions (i.e. there is no 'x' or missing dimension

Theano Dimshuffle equivalent in Google's TensorFlow?

萝らか妹 提交于 2020-01-03 08:41:28
问题 I have seen that transpose and reshape together can help but I don't know how to use. Eg. dimshuffle(0, 'x') What is its equivalent by using transpose and reshape? or is there a better way? Thank you. 回答1: There are three relevant ops for implementing Theano's dimshuffle in TensorFlow: tf.transpose() is used to permute the dimensions of a tensor. If the pattern specified in the arguments to dimshuffle is a permutation of the input tensor's dimensions (i.e. there is no 'x' or missing dimension

Is there a common format for neural networks

瘦欲@ 提交于 2020-01-03 07:17:33
问题 Different teams use different libraries to train and run neural networks (caffe, torch, theano...). This makes sharing difficult: each library has its own format to store networks and you have to install a new library each time you want to test other teams' work. I am looking for solutions to make this less tedious: - Is there a preferred (shared?) format to store neural networks? - Is there a service or library that can help handle different types of networks / or transform one type into

Keras imageGenerator Exception: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None

◇◆丶佛笑我妖孽 提交于 2020-01-02 05:29:06
问题 I'm currently trying to follow the example here using a dataset I generated by myself. The back end is run using Theano. The directory structure is exactly the same: image_sets/ dogs/ dog001.jpg dog002.jpg ... cats/ cat001.jpg cat002.jpg ... validation/ dogs/ dog001.jpg dog002.jpg ... cats/ cat001.jpg Here is my code for the keras convolutional neural network. img_width, img_height = 150, 150 img_width, img_height = 150, 150 train_data_dir = './image_sets' validation_data_dir = './validation'

Keras 1.0: getting intermediate layer output

别说谁变了你拦得住时间么 提交于 2020-01-02 04:33:05
问题 I am currently trying to visualize the output of an intermediate layer in Keras 1.0 (which I could do with Keras 0.3) but it does not work anymore. x = model.input y = model.layers[3].output f = theano.function([x], y) But I get the following error: MissingInputError: ("An input of the graph, used to compute DimShuffle{x,x,x,x}(keras_learning_phase), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.", keras_learning_phase