tensorflow - AttributeError:模块“tensorflow._api.v2.image”没有属性“resize_images”
问题描述
我正在使用预训练模型来检测对象,因为我得到了错误 tensorflow version = 2.2.0 keras version = 2.3.1
下面是我的代码
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.1.h5"))
detector.loadModel()
custom_objects = detector.CustomObjects(person=True, car=False)
detections = detector.detectCustomObjectsFromImage(input_image=os.path.join(execution_path ,"image.jpg"),output_image_path=os.path.join(execution_path , "image_new.jpg"), custom_objects=custom_objects, minimum_percentage_probability=65)
for eachObject in detections:
print(eachObject["name"] + " : " + eachObject["percentage_probability"] )
print("--------------------------------")
解决方案
推荐阅读
- c# - Blazor Json 到类转换失败
- reactjs - 从对象中删除键不起作用
- c++ - 在 C++20 中是否仍然无法转发所有可调用对象?
- c++ - Pythran“未定义对‘ATL_caxpby’的引用”错误
- javascript - 是否可以在托管的 Expo 应用程序中使用 Google Places 自动完成服务?
- ruby - 如何将字符串数组转换为值(符号)?
- intro.js - 按钮和箭头在 intro.js 中有不同的导航行为
- sql-server - SQL Insert 列顺序很重要
- excel - 将 Excel Powerpivot 中的 IF 函数与 DAX 结合使用
- php - 无法在 gmail smtp php 中使用主题和格式