Questions tagged [keras-layer]
1512 questions
0
votes
1 answer
Keras - Theano - Test for division by zero
I have a Layer that computes the mean of timesteps and supports masking.
My problem is that there may be the case that the mask is empty (no padded timesteps) but i don't know how to check for zeros when working with tensors.
I have a few training…

Christos Baziotis
- 5,845
- 16
- 59
- 80
0
votes
0 answers
Indexerror: out of bounds for size error in keras convnet1D
I am trying to use CNN 1D for time series prediction. I have a time series data set with 30 features, 3 targets and more than 3000 rows.
This is my keras model
model = Sequential()
model.add(Embedding(64, 10, batch_input_shape= (100,30))) #100 time…

Eka
- 14,170
- 38
- 128
- 212
0
votes
1 answer
Keras Convolution2d layer input shape
i am basically trying to build a deep model which consists of many convolution2d layers followed by maxpooling 2d as follows :
model.add(Convolution2D(128, 54, 7, input_shape=(1, 54, 180)))
model.add(MaxPooling2D(pool_size=(1,…

meme mimis
- 81
- 1
- 6
0
votes
1 answer
Get desired output from convolution (GAN)
I'm trying to code a GAN model for cifar10.
But I have a problem.
How to get the desired ouput (3x32x32) from a convolutional network ?
I actually inspire my model from one I found for the mnist :
model = Sequential()
model.add(Dense(input_dim=100,…

Pusheen_the_dev
- 2,077
- 4
- 17
- 33
0
votes
0 answers
something wrong with my keras's embedding's test
Here is my python's code runned on pyspark with distkeras.
from keras.layers.embeddings import Embedding
from keras.layers.recurrent import LSTM, GRU
from pyspark.ml.feature import VectorAssembler
from keras.models import Sequential
from…

sodaling
- 39
- 1
- 3
0
votes
1 answer
Why are the filters in conv_filter_visualization example 128x128?
This Keras conv_filter_visualization example outputs an 8x8 grid of visualized weights for layer 5 of the VGG-16 network. The code goes through 128 of the 512 filters, and visualizes the weights of those which give the highest loss. An output…

John
- 303
- 2
- 12
0
votes
1 answer
Cyclic loss in tensorflow
I want to build a network that, for a given input, predicts the hour of the day. The result should be in range 0 to 24.
I tried to solve it as a classification problem but that doesn't seem to be the right way. My problem is that I don't know how to…

GiladD
- 33
- 4
0
votes
1 answer
Write my own keras layer
I want to write my own keras layer with taking as input a tensor with shape (nb_batch, input_dim) and producing a tensor with shape (nb_batch, context_size, output_dim) . I have write a demo below:
class MyLayer(Layer):
def __init__(self,…

Hungry fool
- 27
- 1
- 6
0
votes
1 answer
Tensorflow + Keras + Convolution2d: TypeError: 'int' object is not callable
I run the code about CNN in my machine, but it got an ERROR feedback.
The snippet of my code:
model.add(Convolution2D(4 ,3 ,5, 5, border_mode='valid' ,input_shape=(200,200,3)))
and I also try:
model.add(Convolution2D(4 ,3 ,5, 5,…

Mengyang LIU
- 3
- 2
0
votes
1 answer
In an input layer, what is the difference between input_dim and the number of nodes on the input layer?
Keras code for reference. Each of my input instances is a 200 dimensional vector, and I'd like the number of nodes on the input layer to be equal to 200. What does the "100" represent in the input dense layer?
model = Sequential([
…

Lakshay Sharma
- 827
- 1
- 7
- 19
0
votes
1 answer
How can I do a CNN (to image) with 1 input and 2 channel output (regressions)?
I am begin in Keras, and I need to implement some type:
A CNN with 1 channel input and 2 channel as output being both regressions?

Tiago Alves
- 69
- 3
0
votes
1 answer
Finding dimensions of a keras intermediate expression
I am implementing a custom keras layer.
The call method in my class is as follows.
def call(self, inputs, mask=None):
if type(inputs) is not list or len(inputs) <= 1:
raise Exception('Merge must be called on a list of tensors '
…

Apurv
- 4,458
- 2
- 21
- 31
-1
votes
0 answers
ModuleNotFoundError: No module named 'keras.engine'
import os
os.chdir(r"/content/Mask_RCNN/samples")
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
ROOT_DIR = os.path.abspath("../")
sys.path.append(ROOT_DIR) # To find…
-1
votes
1 answer
ValueError: Unknown layer: 'CustomScaleLayer'. Please ensure you are using a`keras.utils.custom_object_scope`
tensorflow version : t2.13.0-rc1
import os
import cv2
import numpy as np
import pandas as pd
import tensorflow as tf
import pytesseract as pt
import plotly.express as px
import matplotlib.pyplot as plt
import xml.etree.ElementTree as xet
from glob…
-1
votes
1 answer
Expected shape=(None, 800, 800, 1), found shape=(None, 640000, 1)
I am getting this error while trying to train my tensor-flow model:
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 800, 800, 1), found shape=(None, 640000, 1)
This is labels.shape:
(100,)
And this…

somethingidk
- 13
- 1
- 5