All Questions
4,995 questions
-1
votes
0
answers
19
views
MobileNet dynamic range quantization breaks model accuracy
I've been working on building a binary fire detection model based on TF keras MobileNet v2 and transfer trained from ImageNet weights. After training the model and inferencing it works well with about ...
-1
votes
0
answers
52
views
Does the fact that i have just train, test split using keras image_from_dataset affect my metrics
I've been trying to figure out why my metrics were low after training. I had an F1 score of 75% which is not what i expected at all. I reviewed the code and I suspected the issue was the train, ...
2
votes
1
answer
82
views
How to compile and run a model in Keras subclassing API?
I am learning to use the TensorFlow Recommenders library and the subclassing API and have been working through the documentation. I would like to know how to run and review the output of the ...
2
votes
0
answers
33
views
Conversion of model weights from old Keras version to Pytorch
I want to transfer pretrained weights from an old project on github : https://github.com/ajgallego/staff-lines-removal
The original Keras model code is:
def get_keras_autoencoder(self, input_size=256, ...
0
votes
1
answer
52
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
56
views
Tensorflow Keras model with interleave is having issues fitting
I'm working on a CNN project where I make use of TensorFlow and Keras. In addition, I use interleave as the dataset is rather large (too large to load into the RAM with our resources). But there's an ...
1
vote
2
answers
68
views
Why does my Keras model show 4 parameters instead of 2?
I'm training a simple Keras model with one Dense layer, but when I call model.summary(), it shows 4 parameters instead of 2.
import tensorflow as tf
import numpy as np
# Generate dummy data
X_train = ...
1
vote
1
answer
87
views
numpy eager execution problem after loading a CNN model
I want to save and load a CNN model to further training. I have developed a model and saved it as .h5 file. There is no problem when creating, training, and saving at first run.
The problem exists ...
9
votes
1
answer
264
views
Clearing tf.data.Dataset from GPU memory
I'm running into an issue when implementing a training loop that uses a tf.data.Dataset as input to a Keras model. My dataset has an element spec of the following format:
({'data': TensorSpec(shape=(...
1
vote
1
answer
68
views
How to have reproducibility with Keras, Tensorflow?
I am not getting the same accuracy and loss each time I run the following code. I followed the instructions from previous posts, but I couldn't resolve it. What could be the problem?
import os
os....
0
votes
1
answer
112
views
Training a Keras model to identify leap years
I'm trying to teach my learning model how to identify leap years.
My Python code can be seen below:
import tensorflow as tf
import numpy as np
import calendar
# ------------------- UTILITY FUNCTIONS -...
0
votes
1
answer
63
views
Always getting ' Your input ran out of data'
I am trying to train a CNN model with an image dataset for medical image segmentation:
history = model.fit(x = train_dataset,
validation_data = val_dataset,
...
0
votes
0
answers
55
views
Keras Training Issue: "Your input ran out of data" Warning and 0 Loss/Accuracy
I am training a CNN model using ImageDataGenerator with a dataset of 1500 training images and 32 batch size. I calculated the steps per epoch as
⌈1500/32⌉=47, the last batch is incomplete and I am ...
0
votes
0
answers
41
views
How do I print out the tensor values in between layers in Keras 3?
I'm using Keras 3 with the PyTorch backend.
I'm trying to port a model written by someone else to another runtime, and I want to dump summary statistics about the tensor after each layer so I can ...
0
votes
1
answer
113
views
Getting Attribute error in Keras Classifier
getting attribute error while passing values to keras classifier
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from sklearn.model_selection import ...