All Questions
Tagged with keras image-processing
452 questions
1
vote
1
answer
2k
views
AttributeError: 'Functional' object has no attribute 'fit_generator'
This is my code for an image processing model -
import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
from keras.layers import Input, Lambda, Dense, Flatten
from keras.models import Model
from keras....
0
votes
1
answer
259
views
AttributeError: module 'keras.utils' has no attribute 'shape'
def convert_to_grayscale(self):
subdirectories = self.list_subdirectories()
for subdirectory_name in subdirectories:
subdirectory_path = os.path.join(self.base_dir, subdirectory_name)
...
0
votes
0
answers
38
views
How i improve the accuracy of image-based bacteria classifier
i'm new with ML. I am tring to develop a model that classifier bacteria by their staining properties. And i got 0.52 accuracy with my model.
İ have 223 images and 2 classes Gram Negative and Gram ...
1
vote
0
answers
67
views
Is there a way to preprocess a single image using the same method as in tf.keras.utils.image_dataset_from_directory?
I have trained a keras model and used tf.keras.utils.image_dataset_from_directory to preprocess the images.
Now when I'm trying to test the model on a single image it's always predicting the same ...
0
votes
0
answers
60
views
How can I add my implemented code as a preprocessing layer to tensorflow Sequential?
I want to add a custom function as a layer for image processing tasks in TensorFlow Keras Sequential. The custom function will hold my code logic of image processing. But, I couldn't find the solution ...
0
votes
1
answer
56
views
mixup for gray image input and color image output
Mixup is a technique to smoothen the training of a neural network by applying convex combination to training inputs:
https://keras.io/examples/vision/mixup/
In the example, the input is gray image and ...
0
votes
1
answer
50
views
ValueError: Dimension 2 in both shapes must be equal, but are 128 and 32. Shapes are [3,3,128,32] and [3,3,32,9]
I'm trying to build a model to perform reconstruction of speech by feeding image frames from a video. But during the prediction, I got the error. Please help me resolve the error.
ValueError: ...
0
votes
1
answer
206
views
shape must be rank 4 but is rank 5 for max pool layer
Hi I want to build a CNN Model for RGB images of 32x32x3
But the max pooling returns error saying:
ValueError: Exception encountered when calling layer "max_pooling2d_11" (type MaxPooling2D)....
0
votes
1
answer
68
views
How to register a custom loss function with keras?
I am trying to use this custom loss function
# calculate binary cross-entropy loss
lbce = -(1/N*M) * np.mean(y_actual*np.log(y_pred) + (1-y_actual)*np.log(1-y_pred))
# calculate mean ...
1
vote
1
answer
168
views
Error calling ImageDataGenerator.flow in Keras
I am working on image augmentation with images having numeric target value for regression problem, and got the error "ValueError: Unsupported channel number: 150". The code and full stack ...
0
votes
1
answer
477
views
FileNotFoundError: [Errno 2] No such file or directory for Image Dataset one-hot encoded
I tried to one-hot encoded using to_categorical() in my image dataset but I failed because of FileNotFoundError: [Errno 2] No such file or directory error and the code is given below,
import os
import ...
0
votes
1
answer
204
views
Image segmentation with Keras and Tensorflow: logits and labels must have the same first dimension when using U-Net architecture
I'm using this tutorial from the keras website: Image segmentation with a U-Net-like architecture. The tutorial runs well, so I want to adapt it for my own use. I have my own data (250x250 images and ...
1
vote
1
answer
2k
views
ValueError: Asked to retrieve element 0, but the Sequence has length 0 while trying to obtain image features using MobileNet
I wanted to use MobileNet to obtain features of all images present in a dataset. But the error mentioned keeps popping up.
The full code that produced the error is:
`
from keras.applications import ...
0
votes
0
answers
48
views
(Tensorflow) Parameter prediction from image
First I will give some context of my situation:
I have a laser that after propagation is observed by a camera. Now the initial parameters of the laser will determine the pattern observed in the image ...
1
vote
1
answer
130
views
How to cut and paste a part of an image randomly to a different location using tensorflow?
I am trying to implement a custom layer in keras.layers where I want to do a custom image augmentation. My idea is to cut out a part of an image from a random location and paste it to a different ...