fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.37k stars 1.97k forks source link

Dimension error for Assign_299 #757

Closed MuhammadHuss closed 5 years ago

MuhammadHuss commented 5 years ago

ValueError: Dimension 0 in both shapes must be equal, but are 3 and 243. Shapes are [3,3,256,720] and [243,256,3,3]. for 'Assign_299' (op: 'Assign') with input shapes: [3,3,256,720], [243,256,3,3]. when i try to use retina model to detect object. i am using this cod.

from imageai.Detection import ObjectDetection import os from time import time

execution_path = os.getcwd()

detector = ObjectDetection() detector.setModelTypeAsRetinaNet() detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best.h5")) detector.loadModel()

our_time = time() custom_objects = detector.CustomObjects(car=True, motorcycle=True) detections = detector.detectCustomObjectsFromImage(custom_objects=custom_objects, input_image=os.path.join(execution_path , "1539341094185.jpg"), output_image_path=os.path.join(execution_path , "image3custom.jpg")) print("IT TOOK : ", time() - our_time) for eachObject in detections: print(eachObject["name"] + " : " + eachObject["percentage_probability"] ) print("--------------------------------")

hgaiser commented 5 years ago

Wrong repository?