Skip to content
Discussion options

You must be logged in to vote

Possible Solution (Saw This on Stack Overflow)

I came across a similar issue before, this error usually happens because Keras doesn’t recognize the YOLOV8Detector class when loading the model.

The main problem is that the entire detector model was saved, but it’s being loaded as a backbone instead. To fix it, you can explicitly define the custom object during loading.

Here’s how you can do it properly:

#  Save the entire detector model
checkpoint_filepath = 'E:/model.yolo_v8_s_ft.keras'
yolo.save(checkpoint_filepath)

#  Later, load with custom objects
from keras_cv.models.object_detection.yolo_v8 import YOLOV8Detector

loaded_model = keras.models.load_model(
    checkpoint_filepath,
    c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DavidMacha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants