Questions tagged [keras]
Keras is a neural network library providing a high-level API in Python and R. Use this tag for questions relating to how to use this API. Please also include the tag for the language/backend ([python], [r], [tensorflow], [theano], [cntk]) that you are using. If you are using tensorflow's built-in keras, use the [tf.keras] tag.
keras
42,496
questions
0
votes
0
answers
6
views
How to preprocess image for INT8 post training quantization?
I am working on a binary classification problem using DenseNet121 on Keras. The original model yields an accuracy of ~93% and when float16 quantized (PTQ), accuracy acceptably drops to ~90%. I was ...
0
votes
1
answer
24
views
Model.evaluate() returning a float, not a list
I have a multi-task neural network. I want to make sure that when I call Model.evaluate() on my model, that the score I see is the sum of the losses. However, it is returning a scalar rather than a ...
0
votes
0
answers
14
views
Cast error while training a keras model constructed using featurespace
I am new to machine learning and using tf/keras to build a simple model to train on Adult database which I downloaded from UCI.
The data has 14 features. I am using keras FeatureSpace API to contruct ...
0
votes
0
answers
20
views
Can you put target value in input x in keras lstm model?
In keras documentation:
Arguments x:
A tf.data.Dataset. Should return a tuple of either (inputs, targets) or (inputs, targets, sample_weights).
A keras.utils.PyDataset returning (inputs, targets) or (...
0
votes
0
answers
19
views
Custom Parametric Activation Function Leading to NaN Loss and Weights
I am trying to create a custom non-linear activation function, and use a 3 3 hidden layer neural network to do MNIST classification. When I use 'Relu' the network trains fine, but when I use my custom ...
0
votes
1
answer
26
views
Error converting Tensorflow model to CoreML model
NotImplementedError Traceback (most recent call last)
Cell In[19], line 1
----> 1 mlmodel = ct.convert(model, convert_to="mlmodel", source="tensorflow")
...
0
votes
0
answers
25
views
Error while exporting Tensorflow model to CoreML
'Sequential' object has no attribute '_get_save_spec'
import tensorflow as tf
import coremltools as ct
print(tf.__version__)
# Load your existing Keras model
model_path = "/Users/name/Desktop/...
0
votes
0
answers
17
views
Error when implementing SHAP on CNN model
So I am trying to implement SHAP to a CNN model I trained on an image dataset on Kaggle. But I keep getting the following Attribute Error:
--------------------------------------------------------------...
0
votes
0
answers
22
views
AttributeError: module 'keras.src.activations' has no attribute 'get'
I am running the following error when I try to optimize a LSTM using keras tuner in Python: AttributeError: module 'keras.src.activations' has no attribute 'get'.
I am using the following versions: | ...
0
votes
0
answers
20
views
Using Sparse Categorical CrossEntropy, the loss becomes negative (tensorflow/keras)
I am doing the Tensorflow TF tutorial (https://www.tensorflow.org/text/tutorials/transformer) but with my own data. My data is not related to text, but it is sequences of tokens anyway, with a start ...
0
votes
0
answers
21
views
Image Classification Model halting at epoch 1/25, tensorflow keras model
I have been following a tutorial of a deep learning neural network model project and for some reason my model halts at the first epoch when trying to train on a dataset of images. I am not sure if ...
0
votes
0
answers
18
views
Expects Inputs Error when loading working model
I've trained a CNN using a pre trained model (EfficientNetB0) and refining it with my data.
(Don't get confused, I did it using a TPU VM, same error everything when not using it)
This is how I did it:
...
0
votes
0
answers
19
views
I get an keras.Layer error when ever i use my code
import numpy as np
import pandas as pd
import PIL
import streamlit as st
import tensorflow as tf
import tensorflow_hub as hub
from geopy.geocoders import Nominatim
import tf_keras
model_url = 'https:/...
0
votes
0
answers
7
views
OperatorNotAllowedInGraphError when trying to set discriminator.trainable property
I'm training a GAN based on the pix2pix architecture, and my training code works in Eager mode. Putting it in graph mode returns the following error:
OperatorNotAllowedInGraphError: Using a ...
0
votes
0
answers
48
views
LSTM Model doesn't train
I am trying to find the chemical state of a particle with deep learning. As inputs I have the position of the particle according to time in X_train with shape (num_train,sequence_length). (My sequence ...