Questions tagged [deep-learning]

1

votes
1

answer
662

Views

keras resume training with different learning rate

I built a simple LSTM model using keras and trained as follows: model = Sequential() model.add(LSTM(activation='tanh',input_dim=6,output_dim=50,return_sequences=False)) model.add(Dense(output_dim=1,activation = 'sigmoid')) model.compile(loss='binary_crossentropy', optimizer =optimizers.Adam(lr = 0.0...
MTANG
1

votes
1

answer
378

Views

Neural Network High Confidence Inaccurate Predictions

I have a trained a neural network on a classification task, and it is learning, although it's accuracy is not high. I am trying to figure out which test examples it is not confident about, so that I can gain some more insight into what is happening. In order to do this, I decided to use the standard...
hockeybro
1

votes
1

answer
157

Views

Edge based binarization

I am trying to implement the edge based binarization algorithm that was written in the research paper 'Automatic License Plate Recognition Using Deep Learning Technique' but i as i implemented it i get the final image all black and can not find the problem. import cv2 import numpy as np def edge_bas...
Ibrahim Sherif Yahia
1

votes
0

answer
182

Views

Seq2Seq prediction speed is slow

i'm trying to implement a Seq2Seq model using LSTM in tensorflow (from scratch, without rnn cell), the model works fine but the predict time for one sentence is slow for me. about 2 -> 6 sec a sentence. Is that normal? My model: 2 LSTM for encode 2 LSTM for decode Attention mechanism Vocabulary: 400...
Khoa Ngo
1

votes
1

answer
213

Views

Why should continuous actions be clamped?

In Deep Reinforcement Learning, using continuous action spaces, why does it seem to be common practice to clamp the action right before the agent's execution? Examples: OpenAI Gym Mountain Car https://github.com/openai/gym/blob/master/gym/envs/classic_control/continuous_mountain_car.py#L57 Unity 3DB...
MarcoMeter
1

votes
0

answer
132

Views

augment the sound wav file

when I extract the x_train from some wav file path new_sample_rate = 8000 y_train = [] x_train = [] for label, fname in zip(labels, fnames): sample_rate, samples = wavfile.read(os.path.join(train_data_path, label, fname)) #print(label ,fname) samples = pad_audio(samples) if len(samples) > 16000: #p...
kim sangwon
1

votes
1

answer
1.2k

Views

Keras - ValueError: If steps_per_epoch is set, the `batch_size` must be None

No mention of such an incompatibility in the doc. What I want to do is declare a number of batches (of fixed given size) to be processed before ending an epoch and starting the next one (shuffling beforehand) in order to try to reduce overfitting. When I chose batch_size=256 and steps_per_epoch=100...
Marvin Lerousseau
1

votes
0

answer
331

Views

Why does Keras model.predict() result in different probabilities based on the size of testing data?

I'm relatively new to Keras and image classification in general and I'm running into an issue that I can't seem to find much information on. So the gist of it is that I've written a slightly modified version of the resnet50 architecture and am testing it on my own training dataset of 5000 images. T...
csblue09
1

votes
1

answer
617

Views

how to find similar images by using CNN model

The requirement of my task is to find the similar output image with the input image in the CNN. There are about half millions images need to be handled with , it would not realistic to label each image. Beyond that, the images are candlestick charts about all stocks, so it is also very hard to class...
hanting du
1

votes
0

answer
95

Views

Dense layer dimension error even after using flatten

I'm new to Keras and using the following model to experiment with the MNIST problem. model = Sequential() model.add(Conv2D(filters=32, kernel_size=(5, 5), input_shape=(28, 28, 1), padding='same', activation='relu', bias_initializer='RandomNormal')) model.add(MaxPooling2D(pool_size=(2, 2), padding='...
RockyMountainEli
1

votes
2

answer
392

Views

i have trained MNIST with accuracy 99.2% but with wrong predictions

I have been using this program to predict my handwritten images to predict a number using previously trained data. The following is the program. please help me out.im new to this This code is used for image processing: import numpy as np import matplotlib.image as mpimg img=mpimg.imread(/images.png...
john joy
1

votes
1

answer
346

Views

TensorFlow Profiler not found

I installed TensorFlow 1.4 using pip. Now, I want to use the native TensorFlow Profiler (tfprof). In the readme it is shown that there should be a comand-line tool tfprof. I can't find the tool tfprof, nor how to access the webUI also shown in this readme. When I try the solution shown in the c...
Holuci
1

votes
1

answer
206

Views

Is tf.recorder way of reading data more efficient than feed to placeholder?

I'm dealing with a huge amount of data in Tensorflow. One way is to define placeholder and then read my data by my own defined functions outside of the graph, such as a queue and feed a batch every time into the placeholders. Another way is to use recorder related built-in classes in Tensorflow to...
Bowen Wen
1

votes
0

answer
23

Views

What is the dimensionality of the weights of the gates of a GRU unit?

I am implementing a neural network in Lasagne, where I would like to share weights between different GRU layers (http://lasagne.readthedocs.io/en/latest/modules/layers/recurrent.html#lasagne.layers.GRULayer). In order to do this, I replace the reset, update and hidden update gates of the GRU layers...
pdekker
1

votes
0

answer
116

Views

Solving FizzBuzz with Keras

I am trying to solve FizzBuzz using Keras and it works quite well for numbers between 1 and 10.000 (90-100% win rate and close to 0 loss). However, if I try even higher numbers, that is numbers between 1 and 100.000 it doesn't seem to perform well (~50% win rate, loss ~0.3). In fact, it performs qui...
LordTribual
1

votes
0

answer
402

Views

defining a siamese network in tensorflow

I know this question has been asked before, however I've a specific question which has not been answered before. I am trying to define a Siamese network in Tensorflow as follows: def conv(self, x, num_out_maps, ksize, stride, activation_fn=tf.nn.relu): padding_length = np.floor((ksize-1)/2).astype(n...
kunal18
1

votes
0

answer
75

Views

Neural Network error is constant

I am building a Recurrent Neural Network based on the one at this link: intro to RNN in Tensorflow But when I try to run it, the accuracy is stuck at 19.1% for the test set and similar values for the train and validation set. From my understanding, it looks like the network is not updating the weigh...
Nadni
1

votes
1

answer
70

Views

labels should start from 0 or 1 in caffe if use softmaxwithLoss as loss layer?

Two questions: 1.For MultinomialLogisticLoss, the label should start from 1, but the caffe doc says it should start from 0.http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1SoftmaxWithLossLayer.html 2.The shape of score(bottom[0]) is NCH*W, and N*1*1*1 for label(bottom[1]) for MultinomialLogist...
spider
1

votes
1

answer
29

Views

How to implement elements comparsion in tensor by Tensorflow?

In my custom loss function, I want to implement this specific computation: Input: tensor A: placeholder([None, 1]) tensor B: placeholder([None, 1]) And A, B has the same shape. Output: tensor res: placeholder([None, 1]). For example: tensor A: [0, 0, 1, 2, 2, 2, 3,...] tensor B: [4, 9, 2, 3, 5...
yuukilp
1

votes
1

answer
126

Views

tensorflow: tensor to ndarray conversion doesn't work - python3.x

I am working on Tensorflow CNN Model and changed according to my scenario. Previously same code worked well on MNIST dataset but now, after feeding my own dataset a placeholder y_true for labels is causing problem. Code snippet: x = tf.placeholder('float',shape=[88, 128]) y_true = tf.placeholder('fl...
MIftikharK
1

votes
1

answer
147

Views

Error while adding Conv1D layer

I am trying to train on a data containing sequences of 43 records of 3-dimensional vectors. While trying to add this Conv1D layer here: model = Sequential() model.add(Conv1D(input_shape=(43, 3), filters=16, kernel_size=4, padding='same')) # This is line 24 of bcl_model_builder.py model.add(BatchNo...
Kaushik Shrestha
1

votes
1

answer
37

Views

How to use tensorflow to build a deep neural network with the local loss for each layer?

I'm a novice on tensorflow (TF). Recently, I feel confused when I try to use TF to construct my deep model, in which each layer has its own (local) loss function. It seems like many deep models (e.g., CNN) implemented by TF has only one (global) loss function, so one can first comput the hidden rep...
Zengjie Song
1

votes
0

answer
296

Views

Input size mismatch error when using pre-trained inceptionV3 model for image classification

I'm facing trouble when training a model using pre-trained inceptionV3 for my own image data set. I'm loading images using data.Dataset loader and 'transforms' for image transformation. Here's my inceptionV3 model inceptionV3 = torchvision.models.inception_v3(pretrained=True) pretrained_model = nn.S...
Sam
1

votes
1

answer
187

Views

How to ignore specific columns for calculating softmax attention?

I am implementing a model which is based on MemoryNetworks. I have triplets data of (context, query, answer). And I want to calculate attention. The attention indicates which sentences in a context should be focused. To formulate mini-batch, I use zero-paddings to create context data. So the followi...
jef
1

votes
1

answer
1.9k

Views

faster-rcnn config file in tensorflow

I am using Google API for object detection in tensorflow to train and infer on a custom dataset. I would like to adjust the parameters of the config file to better suit my samples (e.g. no. of region proposals, size of ROI bbox, etc.). To do so, I need to know what each parameter does. Unfortunately...
Hafplo
1

votes
0

answer
136

Views

How to store large feature vectors for a huge dataset for image retrieval application (CBIR)?

I am building a CBIR application . I am using the features extracted from a deep convnet. The feature vectors are quite big ( about 100,000 in size) . And the dataset has more than 10k images. I have already gone through the answer to this problem, and I don't want to use the libraries mentioned i...
Arko1696
1

votes
1

answer
43

Views

What does the is_sparse mean in StreamDef?

I'm new to CNTK and quite confused about the is_sparse argument in StreamDef. Does it mean the input file has to be in some specific format?
whuala
1

votes
0

answer
75

Views

TF Slim eval_image_classifier 0 accuracy on pre-trained ckpts

Running tf slim's eval_image_classifier.py with the inception_v3, inception_v4 and resnet_v2_152 checkpoints pre-trained by google, all give 0% accuracy consistently. Changing the code a little to add TruePositives, TrueNegatives, FalsePositives and FalseNegatives as metrics shows this. eval/TruePo...
Matt Fly
1

votes
1

answer
1.7k

Views

Getting CUDA out of memory

Im trying to train a network but i get, I set my batch-size as 300 and i get this error,but even if i reduce this to 100 i still get this error,and more frustratingly for running 10 epoch on ~1200 images it takes about 40 minutes,any suggestions what is going wrong and how may i speed the process! A...
Ryan
1

votes
1

answer
39

Views

Dynamic infoGainMatrix (H) in InfoGainLossLayer, Caffe

I am trying to scale the contribution of the positive samples and negative samples in the classification loss (l_cls) differentially in the multitask loss function(L) of RPN in Faster-RCNN. As far as I know, the straight forward way to do this in Caffe is to use ‘InfoGainLossLayer’ and pass an i...
Joseph
1

votes
0

answer
26

Views

How to select features when you have image(pixels) with extra information(categories)?

Suppose you need to train your classifier on a dataset that has images as well as more descriptor features available (along with the labels of-course). For eg. if you have to classify cats vs dogs, and you are provided with the image, weight and age of each animal. If I just had the image, I could...
Dhruv Batheja
1

votes
0

answer
70

Views

Change and use pre-trained model architecture

I am using Tensoflow object detection API for detection of objects.Currently, I am using MobileNet pre-trained model. Now I need to evaluate pre-trained model results under different forms of the model.To do that I need to do some slit changes to the model architecture. Is it possible?. If then How...
Chamod Pathirana
1

votes
0

answer
338

Views

Keras model.predict - argmax always outputs 0 (seq2seq model)

I am working with the spelling bees code and applying it to a similar seq2seq task. I am struggling with the predition and the output of the argmax function. For some reason the output of the argmax returns only 0 for any case. I have changed a lot of parameters, chose other axis .. But nothing seem...
agata
1

votes
0

answer
51

Views

Loading Images in Nested folders for building CNN in R with tensorflow

I am trying to build a CNN with R using tensorflow. I have following structure; Main directory(Images Folder) has got three sub-directories/sub folders for; Train Test Valid Each of these folders(trains, test,valid) have many sub-folders. all of these sub-folders have images. so overall structure fo...
akhicoda
1

votes
2

answer
237

Views

Does a Convolutional Layer Have an Exact Inverse

...and if so under what circumstances? A Convolutional Layer usually yields an output of lesser size. Is it possible to reverse/invert such an operation by flipping/transposing the used kernel and providing padding or likewise? Just looking at the convolutional layer's operation here - without pooli...
Dave
1

votes
0

answer
501

Views

CTC Loss not decreasing in Keras

I am using Keras with theano backend for online handwriting recognition problem as solved in this paper: http://papers.nips.cc/paper/3213-unconstrained-on-line-handwriting-recognition-with-recurrent-neural-networks.pdf. I followed the Keras image ocr example https://github.com/keras-team/keras/blob/...
Aayushee
1

votes
0

answer
223

Views

Caffe net.forward call for multiple batches

I am using ImageData type of data in .prototxt file and trying to get the features from python code using net.forward() and net.blobs of caffe library. However, I get only 50 features after net.forward() call which is the batch_size which I have set in .prototxt file. How can I get the features for...
PallaviJog
1

votes
1

answer
557

Views

How to oversample image dataset using Python?

I am working on a multiclass classification problem with an unbalanced dataset of images(different class). I tried imblearn library, but it is not working on the image dataset. I have a dataset of images belonging to 3 class namely A,B,C. A has 1000 data, B has 300 and C has 100. I want to oversampl...
ReInvent_IO
1

votes
0

answer
280

Views

Using tf.train.SyncReplicasOptimizer with multiple optimizers

I am trying to run the DeepLab Resnet (https://github.com/DrSleep/tensorflow-deeplab-resnet) in a distributed setup. I opted Synchronous Data parallel training approach similar to the one demonstrated in Inception's distributed training example.(https://github.com/tensorflow/models/tree/master/resea...
Ash
1

votes
0

answer
230

Views

Batch normalization of images of range [0 inf]

I'm working on an autoencoder network, outputting medical images. The image pixels values are quantitative and of range [0 inf]. My network input is also quantitative of range [0 inf]. Basically, if the input pixel values are increased by a factor 10, so should the output pixel values. Most work I'...
Ida

View additional questions