imageAI实现目标检测(不用opencv)
2021-06-17 14:50 tangxiaosheng 阅读(360) 评论(0) 编辑 收藏 举报参见 https://www.jiqizhixin.com/articles/2018-07-02-7,实践过程中碰到运行错误“找不到libcudart.so.11.0 ”
,这样解决,参考
【tensorflow】缺少libcudart.so.11.0和libcudnn.so.8解决方法,
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" sudo apt-get update sudo apt-get -y install cuda
后来又提示“module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'”。
在generic_utils.py中增加2个函数:
def to_snake_case(name): intermediate = re.sub('(.)([A-Z][a-z0-9]+)', r'\1_\2', name) insecure = re.sub('([a-z])([A-Z])', r'\1_\2', intermediate).lower() # If the class is private the name starts with "_" which is not secure # for creating scopes. We prefix the name with "private" in this case. if insecure[0] != '_': return insecure return 'private' + insecure def populate_dict_with_module_objects(target_dict, modules, obj_filter): for module in modules: for name in dir(module): obj = getattr(module, name) if obj_filter(obj): target_dict[name] = obj
但还是报错:“Version:0.9 StartHTML:0000000105 EndHTML:0000000727 StartFragment:0000000141 EndFragment:0000000691
2021-06-17 14:32:39.658178: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (HP-tangjian): /proc/driver/nvidia/version does not exist
”
估计电脑没有gpu导致这个错误。
别的方式实现目标检测
可以参考 目标检测算法实践
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步