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

Keras Shape errors when trying to use pre-trained model

I want to use a pre-trained model (from Keras Applications), with weights, and append my (very simple) CNN model at the end. To this end I am trying to loosely follow the tutorial here under the sub-header 'Fine-tune InceptionV3 on a new set of…
brosefzai
  • 49
  • 5
0
votes
1 answer

import "tensorflow.keras.applications" could not be resolved (reportMissingImports) in google-colaboratory

I am trying to import tensorflow.keras.applications in Google Colab. The imported module works fine. There is no compilation error. But, I am being shown a yellow curved underline, kind of a warning. Error: What is the problem that leads to such a…
0
votes
0 answers

'Filename' error when trying to do Image Augmentation

I am trying to implement image augmentation of the fruits data set and now without doing this augmentation part my model runs but validation accuracy is low (very low) so i tried for this method and i ran into this problem train_data,val_data =…
Nugget
  • 58
  • 7
0
votes
1 answer

Keras Assertion Error while Fitting Model

I am trying to replicate this model on my dataset: https://docs.seldon.io/projects/alibi/en/stable/examples/cem_iris.html TF.Version: 2.8.2 Keras Vesion: 2.8.0 I'm getting "Assertion Error" when I try to fit the model. My dataset has 59columns and…
prof31
  • 75
  • 1
  • 7
0
votes
0 answers

Average the same model over multiple runs or take an ensamble of a multitude of the same model?

Currently I'm averaging predictions using the same model, I re-initialize the model and fit to a different test set of data from the same data sample, then I average over all of the prediction accuracies Seems there are multiple possible ways to do…
Relative0
  • 1,567
  • 4
  • 17
  • 23
0
votes
1 answer

How to merge 2 trained model in keras?

Good evening everyone, I have 5 classes and each one has 2000 images, I built 2 Models with different model names and that's my model code model = tf.keras.Sequential([ tf.keras.layers.Conv2D(32, (3, 3), activation='relu', …
0
votes
1 answer

transfer learning using tensforflow.keras shown 90% accuracy but single image prediction shows differently

I am trying transfer learning via tensorflow.keras but someting is not working out. The training is showing a nice curves (Training Loss and Validation loss nicely droping ,validation_accuracy increases to 90%). So far all good. My issue is that…
0
votes
0 answers

Tensorflow - Keras how to pass string to first layer and obtain string from last layer

I am trying simple model for prediction sha1 hashes of strings, which should take the dataset consisting of string:sha1_string. Dataset is generated in code. import hashlib import random import string import csv import numpy as np import pandas as…
dimapv
  • 1
  • 1
0
votes
0 answers

tf.keras.metrics.Metric custom accuracy shape error for multi classification

class BinaryTruePositives(tf.keras.metrics.Metric): def __init__(self, name='Results', **kwargs): super(BinaryTruePositives, self).__init__(name=name, **kwargs) self.true_positives = self.add_weight(name='tp', initializer='zeros') def…
0
votes
0 answers

How to Improve accuracy Multilabel sequential text classification

I have a dataset which consist of patient complaints as a input and multiple diagnoses as a output. I tokenized every word of input text with padding so it like [22,10,4,5,0,0,0,0] and output is diagnosis which is one-hot encoding…
0
votes
1 answer

ValueError: Exception encountered when calling layer "p_re_lu_1" (type PReLU)

I have been facing following error while iterating through a a range of neurons and activation functions. The error is encoutered only in case of Prelu and none of the other activation functions result in the same affect. Neither am I able to deduce…
0
votes
0 answers

How can I use my CNN model features to train a Extreme Learning Machine Model

I have a CNN model implemented using python to classify an image dataset. Now I want to use the features from this model in an Extreme Learning Machine (EML) model. How can I extract the features from my CNN model and later use them for the EML…
0
votes
1 answer

Custom Keras loss to minimize count of elements above a given threshold

I am trying to create a custom loss function for a regression problem that would minimize the number of elements that falls above a certain threshold. my code for this is: import tensorflow as tf epsilon = 0.000001 def custom_loss(actual,…
0
votes
1 answer

how to solve error from "# Output the prediction result. new_model.predict_classes(x_test[0:1])" on Keras

I have a Keras-related problem: code: new_model.predict(x_test[0:1]) output: array([[0.03558755, 0.03124422, 0.12950344, 0.29694492, 0.08063059, 0.13757695, 0.18792078, 0.01830993, 0.07450092, 0.0077808 ]], …
0
votes
0 answers

Can't get Keras Code Example #1 to work with multi-label dataset

Apologies in advance. I am attempting to recreate this CNN (from the Keras Code Examples), with another dataset. https://keras.io/examples/vision/image_classification_from_scratch/ The dataset I am using is one for retinal scans, and classifies…
brosefzai
  • 49
  • 5