Questions tagged [keras-layer]
1512 questions
0
votes
1 answer
Problems with input shapes at finetuning VGG with Keras
I'm trying to finetune the last layer of the VGG-16. Here is the part of the code where i make the new model:
def train2false(model):
for layer in model.layers:
layer.trainable = False
return model
def…

Eric
- 1,108
- 3
- 11
- 25
0
votes
1 answer
Create new merge layer operation for Keras
I would like to create my own operations to merge networks. So I've taken a look to the code, and I modified engine/topology.py to create my new operation.
I didn't modified layers/wrappers.py because it's only for RNN and when I modify it I get an…

FiReTiTi
- 5,597
- 12
- 30
- 58
0
votes
1 answer
Why does keras function "expand_dims" change the type?
I'm using keras with a theano backend. Now I have a variable x, which is an theano tensor with a type field "TensorType(float32, 3D)".
I added
from keras import backend as K
at the beginning of my file. Then I wrote:
x = K.expand_dims(x,…

ptr
- 1
- 1
- 4
0
votes
0 answers
How to classify sentences using word2vec and keras?
I have 2 lists of sentences. First list contains different questions, second contains different statements.
Little example:
1st list:
[
"What are cultures that are associated with core values?",
"How do bumblebees fly?",
"It is possible…

Dmytro Nalyvaiko
- 1,664
- 4
- 16
- 27
0
votes
2 answers
Can I use a neural network on a linear regression using Keras? If yes , How?
I'm having difficulties setting up a NN in Keras. Please help me!
This is my code and I'm getting random values every time when I predict.
model = Sequential()
layer1 = Dense(5, input_shape =…

vermanil
- 212
- 1
- 8
0
votes
0 answers
Merge layer keras with tensorflow backend
I wanted to merge two sequential models into one using a Merge layer but it is showing me an error. I am working with images, with size 128x128 (RGB image) and batch size is 32.
The error is:
ValueError: The model expects 3 input arrays, but only…

Rapa
- 43
- 9
0
votes
1 answer
Keras Autoencoders - How to visualize the values of the hidden layer?
I am trying to do a project where the values of hidden layers play a pivotal role. I am trying to use a sample autoencoder from this tutorial,
https://blog.keras.io/building-autoencoders-in-keras.html
I am able to do the gradient descent and it is…

Prudhvi Raj
- 1
- 1
0
votes
0 answers
While I am training a network in Keras+Theano, it is giving error.
I was trying to train a network in keras with theano backed. I am beginner in keras and theano. It is showing a lot of error, could you please if someone knows how to solve it, please share it here?
train images/masks shape:
(20, 1, 565, 565)
train…

S.EB
- 1,966
- 4
- 29
- 54
0
votes
0 answers
Can't add a LSTM layer to model
I'm using python 3.5, and here are some packages that are installed:
Keras 2.0
TensorFlow 0.12.1
Theano 0.8.2
Here is my code:
from keras.models import Sequential
from keras.layers import LSTM
model = Sequential()
model.add(LSTM(512,…

Ань Ле
- 1
0
votes
0 answers
What is Correct implementation for the network given in the figure using keras?
I'm trying to implent this network (https://arxiv.org/pdf/1604.03505)
(source code file - https://gist.github.com/kanihal/8b981b75cb6f22264c0af03be79b243a)
Is this the correct implementation of network given below using functional api?
I'm stuct…

jaggi
- 357
- 1
- 4
- 17
0
votes
0 answers
Visualizing the input that maximizes the activation of a layer with dropout in Keras
I'm trying to replicate the code in this blog article How convolutional neural networks see the world
It works well in a CNN where there's no dropout layer but when there's one (or more) dropout layers, I can't directly use the layer.output line…

Merwann Selmani
- 1,066
- 8
- 7
0
votes
1 answer
Using model.pop() changes the model's summary but does not effect the output
I am trying to remove the top layers from a model I have previously trained.
This is the code I use:
import os
import h5py
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from…

user2182857
- 718
- 8
- 20
0
votes
1 answer
ImportError: No module named numpy.distutils.core (during keras installation)
I want to install keras module (github-link). I tried pip install keras.It installed 1.2.1. It does not have Graph module as per this. Sadly the documentation is also is not updated. So I tried a previous version 1.1.2.and as per the answer by Chang…

Paul Schimmer
- 161
- 3
- 22
0
votes
1 answer
Is it plausible to get a lower mse with more SpatialDropouts?
I have made the observation that with a
SpatialDropout2D(0.2)
layer after each of 5 Convolutional2D layers, the training and validation error is much lower during the first few epochs than with the same network without these Dropout layers (all…

Oblomov
- 8,953
- 22
- 60
- 106
0
votes
1 answer
Verifying the output of an isolated layer in keras
Is it possible to verify the output of
Cropping2D(cropping=((22, 0), (0, 0)),
input_shape=resized_image.shape)
Without constructing and training a model? I.e. I just want to pass and image to Cropping and get and display the…

Oblomov
- 8,953
- 22
- 60
- 106