imageAI实现目标检测(不用opencv)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了imageAI实现目标检测(不用opencv)相关的知识,希望对你有一定的参考价值。
参见 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导致这个错误。
以上是关于imageAI实现目标检测(不用opencv)的主要内容,如果未能解决你的问题,请参考以下文章
[Python图像识别] 四十五.目标检测入门普及和ImageAI“傻瓜式”对象检测案例详解