Skip to main content

All Questions

-1 votes
1 answer
283 views

Keras Image Data Generator Invalid File Name(s) Error

I am doing image augmentation. I have 3662 images belonged to 5 classes. Here is my image data generator. train_data_generator = idg.flow_from_dataframe(train_data, directory = train_image_dir, ...
imdatyaa's user avatar
1 vote
0 answers
143 views

Applying a flip function to image data generator causes memory error

I've been looking at this tutorial for implementing time test augmentation to my model. Since I'm using image generators I tried doing something like this: tta_datagen = ImageDataGenerator() ...
WholesomeGhost's user avatar
1 vote
1 answer
3k views

How to change the dtype of data in tf.data.Dataset?

I have a dataset loaded from a directory using this API val_ds = tf.keras.preprocessing.image_dataset_from_directory( data_dir, validation_split=0.3, subset="validation", seed=123, ...
Yafaa's user avatar
  • 337
0 votes
0 answers
164 views

Changing the shape of an image to match dimensions of input shape of model

I trained a model that expects an input shape of (None, 9, 100, 100, 3). When I run the following code: start_frame = 1 while success: ...
ollie_indy's user avatar
2 votes
1 answer
318 views

how to pass an array instead of path in keras preprocessor

I want to convert an image that was loaded by cv2 into an specific format with keras preprocessor. The keras.preprocessing.image.load_image() function takes input as path but i have only the numpy ...
Mohan Raj's user avatar
  • 197
1 vote
1 answer
237 views

Keras CNN: Incompatible shapes [batch_size*2,1] vs. [batch_size,1] with any batch_size > 1

I am Fitting a Siamese CNN with the following structure: def get_siamese_model(input_shape): """ Model architecture """ # Define the tensors for the three input images ...
AlArzt's user avatar
  • 13
0 votes
1 answer
238 views

Getting Value Error for keras model when running in flask - Python 3

I have a facial recognition model which works fine when an image is passed to it, whether as a seperate file, or a webcam capture. However, I moved it to a browser basd application and sent the webcam ...
RishiC's user avatar
  • 826
2 votes
1 answer
871 views

Keras Realtime Augmentation adding SaltandPepper and Gaussian Noise

I am having trouble with modifying Keras' ImageDataGenerator in a custom way such that I can perform say, SaltAndPepper Noise and Gaussian Blur (which they do not offer). I know this type of question ...
ilovewt's user avatar
  • 1,023
1 vote
1 answer
2k views

CNN Keras is not accepting 1 channel for Black and white images

I have converted my images to black and white using the below code image_file = Image.open('colored.png') # open colour image image_file = image_file.convert('1') # convert image to black and ...
Maysa Sarsour's user avatar
1 vote
2 answers
655 views

CNN low accuracy cats vs dogs dataset

I have a train folder, which contains cats folder (5000 pics inside it) and dogs folder (4000 pics inside it). Also, I have a test folder, which contains cats folder (2500 pics) and dogs folder (2000 ...
Maysa Sarsour's user avatar
0 votes
1 answer
1k views

IndexError: index 8 is out of bounds for axis 1 with size 8. When i'm giving 9 instead of 8 it works but accuracy is too low

i've made a matrix by concatenating the traing images A = np.concatenate((folder[0], folder[1], folder[2], folder[3], folder[4], folder[5],folder[6], folder[7])) I've defined a matrix which is a ...
SREE LAKSHMI's user avatar
0 votes
1 answer
10k views

TypeError: __init__() missing 1 required positional argument: 'kernel_size'

Here is the code I've run: def fish_model(): model = Sequential() from keras.layers import Activation, Dense from keras.layers.convolutional import Convolution2D from keras.layers....
SREE LAKSHMI's user avatar
0 votes
1 answer
691 views

ValueError: cannot reshape array of size 445513728 into shape (2266,256,256,1)

here is the code that i'm trying to run labelled_data = [data, Label] X,Y = [labelled_data[0],labelled_data[1]] X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.4, ...
SREE LAKSHMI's user avatar
1 vote
1 answer
1k views

Keras ImageGenerator : IndexError: list index out of range

I loaded the data from kaggle kernel to my machine for reprodicing, now the code is not working, but works on the keras on same python environment. Here is the code and the bug. def ...
Wisdom258's user avatar
  • 173
0 votes
0 answers
36 views

which part of the code is using memory? and how do I use 'del' to reset the memory?

for one epoch for this image process using more than 80 ram memory I know the 'del' command to delete the memory usage del dataframe I want to use 'del' command to free the memory after one epoch ...
user avatar

15 30 50 per page