Проблема с форматом моделей Tensorflow на MacOS - PullRequest
0 голосов
/ 13 ноября 2018

Я пробую пример imageai, найденный в https://towardsdatascience.com/object-detection-with-10-lines-of-code-d6cb4d86f606:

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath( os.path.join(execution_path , "resnet50_coco_best_v2.0.3.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "image.jpg"), output_image_path=os.path.join(execution_path , "imagenew.jpg"))

for eachObject in detections:
    print(eachObject["name"] , " : " , eachObject["percentage_probability"] )

Однако я получаю эту ошибку:

TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Чем это вызвано?Является ли imageai несовместимым с последней версией тензорного потока, как предложено здесь: Tensorflow Slim: TypeError: Ожидается int32, вместо этого получен список, содержащий тензор типа _Message ?

Если так, что я могсделать, чтобы это работало с этим примером imageai?

РЕДАКТИРОВАТЬ: я проверил, и это работает на Windows с Python 3.6

...