Questions tagged [tf.keras]

[tf.keras] is TensorFlow's implementation of the Keras API specification. Use the tag for questions specific to this TensorFlow module. You might also add the tag [keras] to your question since it has the same API.

is TensorFlow's implementation of the Keras API specification. Use the tag for questions specific to this TensorFlow module. You might also add the -tag to your question since it has the same API.

gives you the power and flexibility of Keras within TensorFlow (see the docs for examples). The API of is described here.

References:

2208 questions
0
votes
1 answer

Unexpected result from boolean_mask

I'm calling tensorflow.boolean_mask using two compatible tensors, but the dimension is off example: for m in range(self.class_dim): labels_m = loop_labels[m] mask_m = mask[m] labels_m = tf.boolean_mask(labels_m, mask_m) The…
user1730250
  • 582
  • 2
  • 9
  • 26
0
votes
1 answer

getting error as 1 positional argument required. inputs. in deep learning model

I am getting this error: one positional argument is required, Inputs on this row: kfolds = cross_val_score(model, X, y, cv = 3) the requirement is a binary classification model. we need to predict the outcome which in 0 or 1. I have used deep…
vithal n
  • 11
  • 6
0
votes
1 answer

how to add 'None' column to nparray

I am trying to use the tf-explain library, but I am running into an error with the validation data for the GradCAM method. I get the following error: WARNING:tensorflow:Model was constructed with shape (None, 100, 100, 3) for input…
Oskar
  • 90
  • 1
  • 10
0
votes
1 answer

What is the proper way to add layers using Keras functional API?

I am trying to use Keras functional API to create a model with 2 branches but I need to add the output of the first branch (path23: m,n,5) with the second one (path10: m,n,1) and I need the output to be (output: m,n,1) and no (output: m,n,5) that is…
deijany91
  • 9
  • 4
0
votes
1 answer

Guiding tensorflow keras model training to achieve best Recall At Precision 0.95 for binary classification

I am hoping to get some help on the titular topic. I have a database of medical data of patients with two similar pathologies, one severe and one much less so. I need flag most of the formers (≥95%) and leave out as many of the latter as…
N0Br41nZ
  • 1
  • 3
0
votes
0 answers

AttributeError: on Tensor object

The code below returns an AttributeError def save_best_model(path_folder, file_name, metric): if metric == 'f1': mode = 'max' elif metric == 'val_loss': mode = 'min' return ModelCheckpoint(path_folder +…
0
votes
1 answer

How to get output for each input after 5 layers of conv1d

I am implementing a 5 layer Conv1D for my data which has the shape: (10000,160,1) the input shape for my conv1d model is : (None,160,1) I am trying to obtain the output of the flattened layer (whose output is (none,8000) in the figure below) My…
Kathan Vyas
  • 355
  • 3
  • 16
0
votes
0 answers

exception encountered when calling layer"featurelayer"(type lambda) name k is not defined

enter image description here I tried use "import tensorflow.keras.backend as K" and "from keras import backend as K" . Both of them report the same mistake. Here is the code. def classification_net(datashape, num_classes): inputs =…
Skylard
  • 1
  • 1
0
votes
1 answer

Can I feed intermediate result back into the CNN and get my final result? (update)

I am new to machine learning. I got the intermediate result of layer 31 of my CNN using the following code: conv2d = Model(inputs = self.model_ori.input, outputs= self.model_ori.layers[31].output) intermediateResult = conv2d.predict(img) I am…
user5793353
  • 33
  • 2
  • 7
0
votes
1 answer

Changing RGB channel intensities using Keras ImageDataGenerator

I have been trying to augment my around 360 images while training a model. This is how the code looks like img_data_gen_args = dict(rotation_range=90, width_shift_range=0.3, height_shift_range=0.3, …
0
votes
1 answer

Fixing memory leak in tensorflow2 during loading the model

I am new to tensorflow-2 and I am experiencing a memory leak in my object detection application. I was able to track the section which causes the issue. class TensorflowObjectDetector: def __init__(self, saved_model_dir: str): def…
Priyamal
  • 2,919
  • 2
  • 25
  • 52
0
votes
1 answer

What does indexing on a connected layer do?

I have been trying to understand this bit of code. I dont quite understand what a slicing operator does to a fully connected layer. Here's the code for context. def generate_condition(self, embedding): conditions = fc(embedding, self.embedd_dim…
Matblanket
  • 55
  • 4
0
votes
1 answer

How to Continue Training from the last acquired best weights?

Keras implementation of YOLOv4 Is it possible in this Keras implementation of YOLOv4 to somehow continue training from the last saved best weights? Something like the following: model_checkpoint_callback = tf.keras.callbacks.ModelCheckpoint( …
Samama Fahim
  • 113
  • 6
0
votes
0 answers

neural network performance almost the same for different types of architectures

I'm trying to predict a numerical value (regression problem) for which I have implemented a neural network of 5 inputs and one output. I have tried different hyperparameters, particularly the number of layers (1-5) and neurons per layer (8, 16, 32,…
mira
  • 41
  • 1
  • 5
0
votes
0 answers

Multi-input LSTM model using Keras Functional API

I have variable-length words which are represented as vectors of boolean vectors. For ex: CAR is represented as [[0,0,1,0,...,0],[[1,0,0,0,...,0]],[0,0,...,0,1,...]] ^ ^ ^ C A …
Aniket Ray
  • 48
  • 8
1 2 3
99
100