Questions tagged [keras-2]

with a new API.

Keras API will now become available directly as part of

264 questions
1
vote
0 answers

Tensorflow Keras Model working on CPU but doesn't work with GPU

I am beginner in Tensorflow and Keras. I ran the code on my CPU with the following configuration and it works completely fine: Tensorflow version: 1.10.0 tf.keras version 2.1.6 But when I try to run the code on a GPU server with the following…
1
vote
0 answers

validation accuracy is 0 with Keras fit_generator

I recently upgraded to Keras 2.2.2. The validation accuracy is zero for all training epochs. My training data has data samples in 2 categories i.e., train_data_dir has 2 subfolders. My validation data (i.e., val_data_dir) has data samples in 1…
1
vote
1 answer

Keras metrics with TF backend vs tensorflow metrics

When Keras 2.x removed certain metrics, the changelog said it did so because they were "Batch-based" and therefore not always accurate. What is meant by this? Do the corresponding metrics included in tensorflow suffer from the same drawbacks? For…
failedentertainment
  • 272
  • 1
  • 2
  • 11
1
vote
1 answer

`decode_predictions` expects a batch of predictions (i.e. a 2D array of shape (samples, 1000)). Found array with shape: (1, 5)

A retrained the inception_v3 model for my own test data. (Backstory: im just trying to understand how the whole process works before im trying it on my 130 class "problem") Now i got the .h5. I tryed to import it and predict some image. But i only…
Tollpatsch
  • 304
  • 4
  • 13
1
vote
1 answer

No data provided for.Need data for each key in

When I run the following code, the following error interrupts training process. ValueError: No data provided for "embedding_15_input". Need data for each key in: ['embedding_15_input'] I would like to mention that I want to construct a lstm…
1
vote
0 answers

Calculating precision, recall and F1 in Keras v2, am I doing it right?

There is already a question on how to obtain precision, recall and F1 scores in Keras v2, here is the method I'm using but the question is: am I doing it right? First of all, F. Chollet says he removed these three metrics from version 2 of Keras…
yannis
  • 819
  • 1
  • 9
  • 26
1
vote
1 answer

Switch between keras backend in same program

Is it possible to switch between keras backend in same python program in which both backend specific functions are imported from the keras internal (tensorflow_backend.py, theano_backend.py and cntk_backend.py). When I set…
n_001
  • 13
  • 2
1
vote
2 answers

Conv2d input parameter mismatch

I am giving variable size images (all 278 images of different size 139 of each category) input to my cnn model. As a fact that cnn required fixed size images, so from here i got solution for this is to make input_shape=(None,Nonen,1) (for tensorflow…
Hitesh
  • 1,285
  • 6
  • 20
  • 36
1
vote
1 answer

Data augmentation using Keras image generator makes training very slow

I have a big data set. Data is about 100k. I further augmented data using ImageDataGenerator . But it makes training process very slow. Without keras image generator function, training process took about 3 mins but when I use ImageDataGenerator…
reshadshuvo123
  • 189
  • 2
  • 12
1
vote
1 answer

how to know which node is dropped after using keras dropout layer

From nick blog it is clear that in dropout layer of CNN model we drop some nodes on the basis of bernoulli. But how to verify it, i.e. how to check which node is not selected. In DropConnect we leave some weights so I think with the help of…
Hitesh
  • 1,285
  • 6
  • 20
  • 36
1
vote
0 answers

Keras input shape error "expected input to have shape (1014,) but got array with shape (1,)"

1. Overview I am using Conv1d for text classification task. I define first input layer like this Input(shape=(self.input_size,), name='sent_input', dtype='int64') # here input_size is 1014. And I am feeding a (143614,) shape numpy ndarray as X and…
Niyamat Ullah
  • 2,384
  • 1
  • 16
  • 26
1
vote
2 answers

Keras predict_generator output differs every time

in the last 2 months I was stucked with this issue and it drove me crazy until I realized my "probabilities" vector from predict_generator is simply wrong. I'm using keras 2, and I've a test folder with sub-directories that contain images (not…
1
vote
1 answer

Training keras with tensorflow: Redundancy in labelling the object or multiple labels on same object

I was training keras with tensorflow for person detection. After the training, when the testing was done so many images contains redundant labeling of person. ie; for a single person in an image, multiple labeling as a person was shown. What is the…
1
vote
2 answers

Testing weighted categorical cross entropy for multiple classes in keras with tensorflow backend

I have an issue that seems to have no straight forward solution in Keras. My server runs on ubuntu 14.04, Keras with backend tensorflow. It has 4 Nvidia Geforce gtx1080 GPUs. I am trying to test the best available implementation of weighted…
geek
  • 65
  • 2
  • 11
1
vote
1 answer

Use ConvXDtranspose on Keras

I wanted to use the layer Conv2Dtranspose and Conv3Dtranspose of Keras in order to do deconvolution (upsampling and convolution at the same time). I can get my model built and compiled, but the upsampling part does not seem to work, even when I…
FiReTiTi
  • 5,597
  • 12
  • 30
  • 58