все библиотеки и код я взял с сайта: https://itproger.com/news/174 , но при запуске выходит непонятная ошибка
ниже прилогаю сам код и ссылку на видео урок по тому же сайту.
код:
ссылка на видеоурок:
Код:
2020-08-10 09:50:23.883335: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2020-08-10 09:50:23.883593: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\__init__.py", line 3, in <module>
from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 99, in <module>
from tensorflow_core import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\google\protobuf\descriptor.py", line 48, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: Не найдена указанная процедура.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/mechanic ayes/main.py", line 1, in <module>
from imageai.Detection import ObjectDetection
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\imageai\Detection\__init__.py", line 3, in <module>
from imageai.Detection.keras_retinanet.models.resnet import resnet50_retinanet
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\imageai\Detection\keras_retinanet\models\resnet.py", line 19, in <module>
import keras
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\__init__.py", line 6, in <module>
'Keras requires TensorFlow 2.2 or higher. '
ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`
Process finished with exit code 1
код:
Python:
from imageai.Detection import ObjectDetection
import os
exec_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(
exec_path, "resnet50_coco_best_v2.0.1.h5")
)
detector.loadModel()
list = detector.detectObjectsFromImage(
input_image=os.path.join(exec_path, "objects.jpg"),
output_image_path=os.path.join(exec_path, "new_objects.jpg"),
)
ссылка на видеоурок: