Questions tagged [keras-2]

with a new API.

Keras API will now become available directly as part of

264 questions
1
vote
1 answer

Convert code from Keras 1 to Keras 2: TypeError: __call__() missing 1 required positional argument: 'shape'

I am trying to convert a V-net code that was written in Keras 1 into Keras 2. It seems that I have an issue with the following class: class Deconv3D(Layer): def __init__(self, nb_filter, kernel_dims, output_shape, strides): assert…
FiReTiTi
  • 5,597
  • 12
  • 30
  • 58
1
vote
0 answers

bilinear sampling in tensorflow

theano.tensor.nnet.abstract_conv.bilinear_upsampling(input, ratio=None, frac_ratio=None, batch_size=None, num_input_channels=None, use_1D_kernel=True) I need to replace this theano backend command with Keras 2.0 or tensorflow backend. Any…
Haroon S.
  • 2,533
  • 6
  • 20
  • 39
1
vote
1 answer

What does util.generic_utils.deserialize_keras_object() function in keras do

In Keras library, activattion.get() calls activattion.deserialize() function which in turn calls util.generic_utils.deserialize_keras_object() function. Can someone explain what happens in deserialize_keras_object() function
abhishek jha
  • 1,065
  • 4
  • 21
  • 41
1
vote
1 answer

Getting tensorboard to work with keras

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. Here's the issue: I wanted to use tensorboard to plot the histograms, other training metrics graphs. I followed…
geek
  • 65
  • 2
  • 11
1
vote
1 answer

Calculation of Keras layers output dimensions

I am currently trying to implement GoogLeNet architecture (InceptionV1) in Keras using theano backend, as I want to generate features for CUB dataset using GoogLeNet model. I found an implementation in Keras here. However, it is based on the earlier…
Pallavi
  • 548
  • 2
  • 9
  • 18
1
vote
0 answers

Keras' ImageDataGenerator.flow() results in very low training/validation accuracy as opposed to flow_from_directory()

I am trying to train a very simple model for image recognition, nothing spectacular. My first attempt worked just fine, when I used image rescaling: # this is the augmentation configuration to enhance the training dataset train_datagen =…
Jozef Morvay
  • 133
  • 3
  • 16
1
vote
0 answers

Erorr using keras 2.0 in R

I am trying to replicate Siraj's code for predicting stock prices in R (https://github.com/llSourcell/How-to-Predict-Stock-Prices-Easily-Demo). This is my code: url <-…
Mislav
  • 1,533
  • 16
  • 37
1
vote
2 answers

Keras: ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[26671,32,32,64]

I am training my network using Keras on tensorflow backend(Keras version 2.1), I have tried many things available on internet, but did not find any solution. My Training set and labels: 26721(each image have size (32, 32,1)) , (26721, 10)…
Lucky
  • 875
  • 1
  • 9
  • 19
1
vote
1 answer

Dimension error with sparse_categorical_crossentropy

I have a weighted sparse_categorical_crossentropy loss which is not working after updating to Keras 2.1.1. The previous version I was using was 2.0.6, and it was working fine then. There are 2 classes (0 and 1) in the Output Layer. I pass the…
nigem6997
  • 21
  • 3
1
vote
1 answer

How to get layer activation on batch during training

I'm using Keras (with tensorflow backend) and trying to get layers output(actual activation) on my training set during train time (using 'fit' function) Is there any way to get the activations of last batch used for training as part of the…
dotannn
  • 131
  • 1
  • 5
1
vote
1 answer

Tensorflow 1.4 Keras issue with respect to model_fn

I have a model function which accepts Features, targets and mode but when I add tf.keras layers I'm currently getting Exception pred must be a Tensor, a Variable, or a Python bool. But, When I run the same code with out using tf.keras but directly…
Kishore Karunakaran
  • 598
  • 1
  • 6
  • 16
1
vote
1 answer

Recurrent Neural Networks (RNN) with different sequences length inputs

I have different length input texts, from few character to hundred words so I decided to use different MAX_LENGTH for each batch instead of fix MAX_LENGTH for all batches (obviously shorter MAX_LENGTH for smaller text). After googling I saw this…
Amir
  • 16,067
  • 10
  • 80
  • 119
1
vote
1 answer

Keras model.pop() not working

I am running Keras 2.0.6 with Python 3.6.2 and Tensorflow-gpu 1.3.0. In order to do fine tuning on the Vgg16 model, I run this code after having hand built a vgg16 architecture and loaded the weights, but I have not called compile() yet: model =…
1
vote
1 answer

Use Merge layer (lambda/function) on Keras 2.0?

I trying to port this model into Keras v2 but I have a problem with following function: def __call__(self, sent1, sent2): def _outer(AB): att_ji = K.batch_dot(AB[1], K.permute_dimensions(AB[0], (0, 2, 1))) return…
Amir
  • 16,067
  • 10
  • 80
  • 119
1
vote
2 answers

Error in creating h5 file (hdf file)

For below code i have save models weights in mnist_weights1234.h5. and want to create same file like mnist_weights1234.h5 with same layer configuration import keras from __future__ import print_function from keras.datasets import mnist from…
Hitesh
  • 1,285
  • 6
  • 20
  • 36