All Questions
26 questions
1
vote
1
answer
130
views
I am learning tensorflow2 in python and i am wondering what sets the ndim?
def build_model(layers):
model = Sequential()
# By setting return_sequences to True we are able to stack another LSTM layer
model.add(LSTM(layers[0], input_shape=(1, 2), return_sequences=...
0
votes
1
answer
72
views
Accuracy falling down tensorflow v1.5
I'm using tensorflow 1.5 and keras 2.1.6. The code is taken from this tutorial and reworked to work on version 1.5. There is it:
import tensorflow as tf
import keras
import numpy as np
import ...
3
votes
1
answer
962
views
Correct way to apply gradients in TF2 custom training loop with multiple Keras models
I am working to implement a custom training loop with GradientTape involving multiple Keras models.
I have 3 networks, model_a, model_b, and model_c. I have created a list to hold their ...
0
votes
1
answer
615
views
How to create training and testing data and feed into keras model?
It might be a very simple question, but as a newbie in keras and machine learning, I am unable to solve this issue. This is a two-class classification problem. My code is written (Source:Kaggle) in ...
0
votes
1
answer
73
views
Tensorflow import issue Python 3.6
I am trying to learn how to create a Machine Learning Algorithm by following a tutorial on YouTube and I am currently stuck on the last part of the last video. I got tensorflow and keras to install ...
1
vote
0
answers
306
views
tf.keras.estimator.model_to_estimator failing to convert keras model with custom and Lambda layers
I've written a model some time ago that uses a few custom layer definitions and has been trained using TF 1.12 and standalone Keras 2.2.4. I've updated the version of TF to 1.14 and switched over to ...
10
votes
3
answers
1k
views
Issue with embedding layer when serving a Tensorflow/Keras model with TF 2.0
I followed the step in one of the TF beginner tutorial to create a simple classification model. They are the following:
from __future__ import absolute_import, division, print_function, ...
1
vote
1
answer
909
views
Tensorflow Fit exits with code 1 without any error message
I'm new to tensorflow. What I'm trying to do is to train a simple neural network to solve the Newton 2 problems, to guess the force value of given mass and acceleration values. The input layer ...
3
votes
2
answers
8k
views
ValueError: total size of new array must be unchanged (Reshape from keras)
For this toy model:
from keras.layers import Input, Dense, Reshape
from keras.models import Model
# this is the size of our encoded representations
compression = 10
input_img = Input(shape=(28,28,...
-1
votes
1
answer
2k
views
how to use y_true/y_test and y_pred?
in this line I used y_true and y_pred:
model.compile(optimizer="rmsprop", loss="categorical_crossentropy", metrics=[precision(y_true,y_pred),recall(y_true,y_pred),fmeasure(y_true,y_pred)])
but a this ...
0
votes
0
answers
344
views
IndexError: index 5407 is out of bounds for axis 1 with size 8
I'm new to python and neural network
This is a part of my code:
y = [[tag2idx[w[1]] for w in s] for s in sentences]
y = pad_sequences(maxlen=max_len, sequences=y, padding="post", value=tag2idx["O"])...
3
votes
1
answer
687
views
keras generator with image and scalar
I am trying to train some layers of a network whose inputs are an image and a scalar. Please see the figure below for a better understanding. .
As you can see only the dark yellow layers will be ...
0
votes
1
answer
240
views
TypeError: cannot perform reduce with flexible type Keras
I have a model definition defined in a json file like below
{
"model": "Sequential",
"layers": [
{
"L1": "Conv2D(filters = '8', kernel_size=(3,3), strides=(1, 1), padding='...
0
votes
1
answer
121
views
How to transfom decoder_target_data to the right shape for Model ouputs
I'm trying to code a word-level machine translation using keras, with an architecture encoder-decoder, using word_embedding and force teaching technique. I read that target_answer has to be the same ...
1
vote
1
answer
392
views
How to expand the output of GlobalAveragePooling2D() to be suitable for BiSeNet?
I am trying to build the BiseNet shown in the figure at "https://github.com/Blaizzy/BiSeNet-Implementation".
When I want to use the GlobalAveragePooling2D() in Keras(tf-backend) to finish the ...