1. 程式人生 > 其它 >imageAI實現目標檢測(不用opencv)

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導致這個錯誤。