Keras is not working on splitted dataset - machine-learning

Here is the code:
I get the following error:
Snapshot of the dataset:
Please suggest me what should I do now to get rid of the error

Related

Why does pandas DataFrame giving 1-Dimesional Error?

I'm doing standardization on dataset after applying standardization I'm converting the resulting array into dataframe and then I got this 1-dimensional error. please help me out.
X_train_scaled = pd.DataFrame(X_train_scaled, columns=X_train_scaled)
X_test_scaled = pd.DataFrame(X_test_scaled, columns=X_test_scaled)

Why is the validation accuracy coming to be the baseline accuracy

I am using EfficientNetB0 for custom training . I get the following output
In order to debug I tried the same data for train and test and get the following error
This is not happening with other networks like Xception and Inception. What can be the reason ?
PS I have displayed only 4 epoch cases but have actually tried out up to 30 and the same problem.
I am pasting a picture of the predictions also. They are the same in each row

How to Use Custom yolov4 weights in iOS app

I following these steps:
Obtained YOLO v4 weights after training on my custom dataset
Converted weights to TensorFlow checkpoints
Converted Tensorflow checkpoint to tflite
Quantized tflite
I was using tflite samples and imported custom tflite to xcode project
But I'm getting a crash:
Failed to create the interpreter with error: Failed to create the interpreter.
ObjectDetection/ViewController.swift:56: Fatal error: Failed to load model
2022-02-28 13:28:22.850305+0530 ObjectDetection[9505:3901451]
ObjectDetection/ViewController.swift:56: Fatal error: Failed to load model
I tested my tflite weights and its working fine
Follow this space for solution https://github.com/ankits16/CVRecorderFinal/blob/main/README.md

Extract vectors from LDA2vec model

I want to implement lda2vec and extract vectors then feed them to the ml classifier. I tried to implement https://github.com/TropComplique/lda2vec-pytorch but I failed.
I got this error No such file 'model_state.pytorch' when I run explore_trained_model.ipynb
can anyone help me?

model.predict_classes vs model.predict_generator in keras

I understand that predict_generator outputs probabilities. To get the class, I just then find the index for the greatest probability and that will be the most probable class. However I find that after doing this, I get a different output than if I were to call predict_classes. I do not understand why. Can someone explain this please?
Generator in Keras uses glob to list folders which are alphabetically sorted, you can get classes being used during training using
# save classes to JSON
class_json = json.dumps(train_generator.class_indices)
with open("class.json", "w") as class_file:
class_file.write(class_json)
The samples are shuffled with in the batch generator(here) so that when a batch is requested by the fit_generator or evaluate_generator random samples are given.
Another possibility if this is being done on images is not to use rescale=1./255 in ImageDataGenerator as mentioned in https://github.com/fchollet/keras/issues/3477
Hope that help!

Resources