2,160 questions
0
votes
1
answer
92
views
multi output forcast shape prob. with keras.preprocessing.timeseries_dataset_from_array
The model was fuctioinnal with only one output, now I try to use multi output forcasting one timestep, but got this error:
Epoch 1/10
2025-11-04 16:20:09.341769: W tensorflow/core/framework/op_kernel....
1
vote
2
answers
87
views
Confused about how tf.keras.Sequential works in TensorFlow – especially activation and input_shape
I'm learning TensorFlow to build machine learning models in Python. I tried following the official documentation on creating a simple classification model, but I couldn't clearly understand the tf....
0
votes
0
answers
100
views
Tensorflow allocates memory on GPU but GPU utilization 0% when running keras.model.fit()?
I am training a CNN using keras and tensorflow on my NVIDIA RTX 2000 Ada Generation Laptop GPU on Ubuntu 24.04 with recommended nvidia-driver-570.
When I train my network on the cpu only version of ...
0
votes
1
answer
65
views
Why won't tf.keras let me pass a dictionary of multiple sample weights?
I am trying to pass individual np.arrays of sample_weights for two outputs of my Keras model, one of which is a confidence measure of a binary value and one of which is a continuous output. However, I ...
0
votes
0
answers
146
views
I'm having difficulty annotating the quantization of Keras's Dense layer within tfmot.quantization.keras.quantize_annotate_layer. What shall I do?
[To give context, this capstone project is an ML visual model for real-world and real time classification of wastes, based on their biodegradability. For better desirability, I chose ResNet50 as the ...
0
votes
1
answer
74
views
gradient tape for custom loss function
I'm currently working with an autoencoder in hopes to test its accuracy vs pca. My tutor asked me to add a custom loss function that involves the derivatives of the decoder output with respect to the ...
0
votes
0
answers
85
views
Problem about training model Deep Learning
When I trained keras tensorflow model, it displayed error message:
This optimizer can only be called for the variables it was originally built with. When working with a new set of variables, you ...
1
vote
1
answer
88
views
Does keras/TF support non-time-step masking?
Masking is a very broad term which normally means ignore part of.
However, the docs on masking describe it as:
Masking is a way to tell sequence-processing layers that certain timesteps in an input ...
0
votes
1
answer
105
views
Why do I get AttributeError: module 'tensorflow.keras.backend' has no attribute 'placeholder' when using ART's KerasClassifier with TensorFlow 2.x?
I’m trying to use the Adversarial Robustness Toolbox (ART) with a simple Keras model in TensorFlow 2.x, but I’m encountering the following error:
AttributeError: module 'tensorflow.keras.backend' has ...
0
votes
0
answers
96
views
Keras newbie: Why doesn't loss decrease when fine-tuning LLaMA 3.2 3B on TPU v3-8 with Keras?
I'm trying to fine-tune Meta's LLaMA 3.2 3B Instruct model using Keras on TPU v3-8 (Kaggle). While the code runs without errors, the loss remains constant during training.
Context:
My wife, a history ...
0
votes
0
answers
31
views
Unrecognized Data Type
I am follwoing the training in the (https://www.bing.com/videos/riverview/relatedvideo?q=deep+learning+with+keras+tensorflow+freecodecamp&&view=riverview&mmscn=mtsc&mid=...
1
vote
0
answers
59
views
Implementing Transfer Learning to train a CNN Model for Distracted Driver Detection
I want to use EfficientNetB0 (or any other base models) from tensorflow.keras.applications to detect distracted drivers. The given dataset consists of approximately 22.5k training images, roughly ...
0
votes
0
answers
58
views
Process finished with exit code 134 (interrupted by signal 6:SIGABRT) with Tensorflow on Mac M1
I am currently trying to run Tensorflow on a Mac with M1 chip and the program keeps constantly aborting when training the model.
The code I have tried is here:
import numpy as np
import scipy.io as ...
0
votes
0
answers
103
views
Permission denied when saving Keras Model
I am getting a permission denied error when trying to save the model through call-backs. The model appears to initially save as the file is there, but then there is the below error at some point ...
1
vote
1
answer
175
views
Why to use combined loss function for segmentation and classification [closed]
I tried to modify the U-NET model for one-dimensional data by providing an additional branch, attached to the last encoding block, whose purpose is to classify data into eighteen areas of the cortex. (...
0
votes
1
answer
53
views
Tensorflow - Training error at the end of each epoch in progbar.py (keras)
After changing laptops, the training of my transformer (a simple translator) fails at the end of the first epoch.
The code is pretty long but I use model.fit() and overridden train_step().
h = ...
0
votes
1
answer
61
views
TF-GNN error when training a graph: ValueError: Could not unbatch scalar (rank=0) GraphPiece
I am trying to model an autoencoder of a graph data to best reconstruct the graph but Im facing an issue when trying to do the training.
I created the graph tensor as follows:
edge_sources = ...
2
votes
0
answers
2k
views
Import "tensorflow.keras.callbacks import EarlyStopping ModelCheckpoint" could not be resolvedPylancereportMissingImports
Problem Statement: I was trying to import Keras components like ModelCheckpoint and EarlyStopping in my TensorFlow project using the following import statements:
from tensorflow.keras.callbacks import ...
1
vote
0
answers
358
views
Import "tensorflow.keras.preprocessing.image" could not be resolvedPylancereportMissingImports while importing ImageDataGenerator
Problem Statement:
I encountered several issues when trying to import Keras components in my TensorFlow project. Initially, I used the following import statements:
from tensorflow.keras.preprocessing....
0
votes
1
answer
215
views
AttributeError: 'Sequential' object has no attribute 'compiled' while using gridsearch.fit
All the 2880 fits failed.
It is very likely that your model is misconfigured.
You can try to debug the error by setting error_score='raise'.
Below are more details about the failures:
2880 fits failed ...
0
votes
0
answers
90
views
Binary Crossentropy on KerasTensors not working
I'm trying to implement this VAE in tf/keras and there seems to be something wrong with binary_crossentropy.
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras....
0
votes
1
answer
84
views
tensorflow tf.function decorator and convergence
I am using a fully connected Neural Network as a function approximator in a more complex model. When I set up the model using the functional API I get convergence to a proper solution and the neural ...
1
vote
1
answer
128
views
'_PrefetchDataset' object has no attribute 'shape' when calling resnet_v2.preprocess_input()
I keep running into this error when trying to preprocess my datasets:
AttributeError: '_PrefetchDataset' object has no attribute 'shape'. Did you mean: 'save'?
I'm currently using ResNet, but I've ...
0
votes
1
answer
36
views
Quantizing a `Serial` tendorflow model throws `Value Error`
I have the following Tensorflow model that I want to quantize:
model = Sequential([
Input(shape=input_shape),
LSTM(lstm_units_1, return_sequences=True),
Dropout(dropout_rate),
LSTM(...
0
votes
1
answer
154
views
Cannot load .keras model
I have trained a KERAS model (EfficientNetB5) on an image dataset, and have saved the new model with new layers into a .keras file. However, I keep getting an input error.
# Load efficientnet model ...