我需要帮助...我使用 imageai 自定义类来创建我自己的检测...
现在我们开始
from imageai.Classification.Custom import ClassificationModelTrainer
model_trainer = ClassificationModelTrainer()
model_trainer.setModelTypeAsResNet50()
model_trainer.setDataDirectory("leads_test")
model_trainer.trainModel(num_objects=1, num_experiments=1, enhance_data=True, batch_size=1, show_network_summary=True)
<...>
from imageai.Detection import ObjectDetection
detector = ObjectDetection()
model_path = "leads_test/models/model_ex-001_acc-1.000000.h5"
input_path = "ECG/IMG_0239.jpg"
output_path = "./output/newimage.jpg"
detector.setModelTypeAsTinyYOLOv3()
detector.setModelPath(model_path)
detector.loadModel()
ValueError: Layer count mismatch when loading weights from file. Model expected 24 layers, found 107 saved layers.