Category : keras

Im trying to do a video frame generator using Keras but I am getting the above error. For neural network training the method Keras.model.fit_generator is used. This requires a generator that reads and yields training data to the Keras engine. import glob import os import sys #from gtts import utils import tensorflow as tf import ..

Read more

I have 9134 files in folder E:DesktopIT FYPDatasettrain In side of this folder there are 4 folders represent 4 classes E:DesktopIT FYPDatasettrainbee #2546 files E:DesktopIT FYPDatasettrainotherInsect #1951 files E:DesktopIT FYPDatasettrainotherNonInsect #684 files E:DesktopIT FYPDatasettrainwasp #3953 files Yet when i use the function tf.keras.preprocessing.image_dataset_from_directory to load my dataset as following train_dataset = tf.keras.preprocessing.image_dataset_from_directory( directory=("e:/Desktop/IT FYP/Dataset/train"), labels="inferred", ..

Read more

I am getting the following error : Traceback (most recent call last): File "Estimate parameters with lstm.py", line 13, in <module> from keras.layers.core import Activation File "/home/zeus/my_env/lib/python3.8/site-packages/keras/__init__.py", line 25, in <module> from keras import models File "/home/zeus/my_env/lib/python3.8/site-packages/keras/models.py", line 19, in <module> from keras import backend File "/home/zeus/my_env/lib/python3.8/site-packages/keras/backend.py", line 36, in <module> from tensorflow.python.eager.context import get_config ..

Read more

Consider the following code: from tensorflow import keras from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.optimizers import Adam def build_model(): model = Sequential() model.add(Dense(units=64, kernel_initializer=’uniform’, activation=’relu’)) model.add(Dense(units=128, kernel_initializer=’uniform’, activation=’relu’)) model.add(Dense(units=64, kernel_initializer=’uniform’, activation=’relu’)) model.add(Dense(units=1, kernel_initializer=’uniform’, activation=’relu’)) optimizer = Adam(learning_rate=0.001) model.compile(loss=’mean_squared_error’, optimizer=optimizer) return model model1 = build_model() model1.fit(X_train, Y_train, epochs=10, batch_size=64, verbose=0) # Initial fitting. ..

Read more

I want working a recommendation system using deep AutoEncoder model. i want help on how to define the mean absolute error(MAE) function and use it to calculate the model accuracy. here is the model Model = Deep_model(train_, layers, activation, last_activation, dropout, regularizer_encode, regularizer_decode) Model.compile(optimizer=Adam(lr=0.001), loss="mse", metrics=[ ] ) Model.summary() define the data-validate data_valid =(train, validate) ..

Read more