Hello. I am trying to generate an object detection model for classifying flowers to be used on the ESP-32 CAM. I have used the edge impulse CLI to upload the Kaggle dataset from Google Colab.
I am resizing the image to 48x48 and using grayscale for my images to save as much space and processing power as possible.
While training the impulse, I am using the board setting for the ESP-EYE (ESP32 240 MHz) as there is no option for an ESP32-CAM out of the box. I am using the FOMO MobileNet v2 0.35 model that comes out of the box with edge impulse with a training cycle of 15, learning rate of 0.01 and batch validation size of 20 %. On training I am getting the following error:
Training on 3449 inputs, validating on 863 inputs
/app/./resources/libraries/ei_tensorflow/constrained_object_detection/util.py:9: RuntimeWarning: divide by zero encountered in true_divide
Trained 51 batches.
Attached to job 7930969…
/app/keras/.venv/lib/python3.8/site-packages/scipy/special/_logsumexp.py:214: RuntimeWarning: invalid value encountered in subtract
return np.exp(x - logsumexp(x, axis=axis, keepdims=True))
Traceback (most recent call last):
File “/home/train.py”, line 430, in
File “/home/train.py”, line 358, in main_function
model, override_mode, disable_per_channel_quantization, akida_model, akida_edge_model = train_model(train_dataset, validation_dataset,
File “/home/train.py”, line 293, in train_model
model = train(num_classes=classes,
File “/home/train.py”, line 276, in train
File “/app/keras/.venv/lib/python3.8/site-packages/keras/utils/traceback_utils.py”, line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File “/app/./resources/libraries/ei_tensorflow/constrained_object_detection/metrics.py”, line 116, in on_epoch_end
y_pred = batch_convert_segmentation_map_to_object_detection_prediction(
File “/app/./resources/libraries/ei_tensorflow/constrained_object_detection/util.py”, line 171, in batch_convert_segmentation_map_to_object_detection_prediction
File “/app/./resources/libraries/ei_tensorflow/constrained_object_detection/util.py”, line 129, in convert_segmentation_map_to_object_detection_prediction
raise Exception(“Expected at least one non background class but”
Exception: Expected at least one non background class but had 1 (shape (6, 6, 1))
Application exited with code 1
I am not able to resolve this error. Any help is appreciated.