theano

CNN with keras, accuracy not improving

谁说我不能喝 提交于 2019-11-30 09:48:38
I have started with Machine Learning recently, I am learning CNN, I planned to write an application for Car Damage severity detection, with the help of this Keras blog and this github repo . This is how car data-set looks like: F:\WORKSPACE\ML\CAR_DAMAGE_DETECTOR\DATASET\DATA3A ├───training (979 Images for all 3 categories of training set) │ ├───01-minor │ ├───02-moderate │ └───03-severe └───validation (171 Images for all 3 categories of validation set) ├───01-minor ├───02-moderate └───03-severe Following code gives me only 32% of accuracy. from keras.preprocessing.image import

Deconvolution2D layer in keras

早过忘川 提交于 2019-11-30 09:20:21
This layer in not ready documented very well and I'm having a bit of trouble figuring out exactly how to use it. I'm Trying something like: input_img = Input(shape=(1, h, w)) x = Convolution2D(16, 7, 7, activation='relu', border_mode='valid')(input_img) d = Deconvolution2D(1, 7, 7, (None, 1, 2*h, 2*w)) x = d(x) but when I try to write d.output_shape , I get the original shape of the image instead of twice that size (which is what I was expecting). Any help will be greatly appreciated! Short answer: you need to add subsample=(2,2) to Deconvolution2D if you wish the output to truly be twice as

theano - print value of TensorVariable

亡梦爱人 提交于 2019-11-30 07:51:47
How can I print the numerical value of a theano TensorVariable? I'm new to theano, so please be patient :) I have a function where I get y as a parameter. Now I want to debug-print the shape of this y to the console. Using print y.shape results in the console output (i was expecting numbers, i.e. (2,4,4) ): Shape.0 Or how can I print the numerical result of for example the following code (this counts how many values in y are bigger than half the maximum): errorCount = T.sum(T.gt(T.abs_(y),T.max(y)/2.0)) errorCount should be a single number because T.sum sums up all the values. But using print

How to set up theano config

﹥>﹥吖頭↗ 提交于 2019-11-30 06:05:42
I'm new to Theano. Trying to set up a config file. First of all, I notice that I have no .theanorc file: locate .theanorc - returns nothing echo $THEANORC - returns nothing theano.test() - passes ok I'm guessing some default configuration was created wen i installed theano. Where is it? nouiz Theano does not create any configuration file by itself, but has default values for all its configuration flags. You only need such a file if you want to modify the default values. This can be done by creating a .theanorc file in your home directory. For example, if you want floatX to be always float32,

Reusing compiled Theano functions

徘徊边缘 提交于 2019-11-30 04:24:30
问题 Suppose I have implemented the following function in Theano: import theano.tensor as T from theano import function x = T.dscalar('x') y = T.dscalar('y') z = x + y f = function([x, y], z) When I try to run it a graph of computations is constructed, the function gets optimized and compiled. How can I reuse this compiled chunk of code from within a Python script and/or a C++ application? EDIT: The goal is to construct a deep learning network and reuse it in a final C++ app. 回答1: Currently this

'::hypot' has not been declared

不羁的心 提交于 2019-11-30 03:46:46
问题 I'm using python3.6 theano, with mingw-w64-x86-64 installed, my os is Win10_64, cuda installed, and seems everything is ok the theano.test() is ok, saying my gpu is working, but it just keeps tell me that "error: '::hypot' has not been declared" C:/mingw64/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/cmath:1157:11: error: '::hypot' has not been declared\r. using ::hypot;\r. ^~~~~\r. ", Any help would be appreciated! 回答1: I had this error with building an python file using mingw32 . I opened

Installing Theano on Windows - DLL load failed

人盡茶涼 提交于 2019-11-29 20:55:06
问题 I am trying to install Theano on Windwos 8 Have followed these steps. I try to test using: import numpy as np import time import theano print('blas.ldflags=', theano.config.blas.ldflags) A = np.random.rand(1000, 10000).astype(theano.config.floatX) B = np.random.rand(10000, 1000).astype(theano.config.floatX) np_start = time.time() AB = A.dot(B) np_end = time.time() X, Y = theano.tensor.matrices('XY') mf = theano.function([X, Y], X.dot(Y)) t_start = time.time() tAB = mf(A, B) t_end = time.time(

Keras accuracy does not change

自闭症网瘾萝莉.ら 提交于 2019-11-29 20:19:12
I have a few thousand audio files and I want to classify them using Keras and Theano. So far, I generated a 28x28 spectrograms (bigger is probably better, but I am just trying to get the algorithm work at this point) of each audio file and read the image into a matrix. So in the end I get this big image matrix to feed into the network for image classification. In a tutorial I found this mnist classification code: import numpy as np from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense from keras.utils import np_utils batch_size = 128 nb

Theano fails due to NumPy Fortran mixup under Ubuntu

天大地大妈咪最大 提交于 2019-11-29 17:23:21
问题 I installed Theano on my machine, but the nosetests break with a Numpy/Fortran related error message. For me it looks like Numpy was compiled with a different Fortran version than Theano. I already reinstalled Theano ( sudo pip uninstall theano + sudo pip install --upgrade --no-deps theano ) and Numpy / Scipy ( apt-get install --reinstall python-numpy python-scipy ), but this did not help. What steps would you recommend? Complete error message: ImportError: ('/home/Nick/.theano/compiledir

Installing Theano on EPD (Windows x64)

安稳与你 提交于 2019-11-29 16:38:15
I'm trying to install Theano on Enthought Python Distribution (EPD), but I am getting a weird error. Here is what my installation looks like: I have installed EPD to C:\Python27 . After that, I have installed pip by using easy_install pip I installed Theano by using pip install Theano To test, I start ipython and type import theano . I get the following error: Problem occurred during compilation with the command line below: g++ -shared -g -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -o C:\Users\Ove\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64