Python 没有名为 'darkflow.cython_utils.cy_yolo_findboxes 的模块
Python no module named 'darkflow.cython_utils.cy_yolo_findboxes
我正在研究用于对象检测的暗网 yolov2。我使用了 pip install .
来编译 darkflow 库。之后当 darkflow 成功安装时。
from darkflow.net.build import TFNet
import cv2
options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}
tfnet = TFNet(options)
imgcv = cv2.imread("./sample_img/sample_dog.jpg")
result = tfnet.return_predict(imgcv)
print(result)
我遇到了这个错误。
C:\Users\IU-506\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
此外,这些也是错误,请查看:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-1bd33c7e6a6f> in <module>()
----> 1 from darkflow.net.build import TFNet
2 import cv2
3
4 options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}
5
~\Desktop\darkflow-master\darkflow\net\build.py in <module>()
5 from .ops import op_create, identity
6 from .ops import HEADER, LINE
----> 7 from .framework import create_framework
8 from ..dark.darknet import Darknet
9 import json
~\Desktop\darkflow-master\darkflow\net\framework.py in <module>()
----> 1 from . import yolo
2 from . import yolov2
3 from . import vanilla
4 from os.path import basename
5
~\Desktop\darkflow-master\darkflow\net\yolo\__init__.py in <module>()
1 from . import train
----> 2 from . import predict
3 from . import data
4 from . import misc
5 import numpy as np
~\Desktop\darkflow-master\darkflow\net\yolo\predict.py in <module>()
5 import os
6 import json
----> 7 from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
8
9 def _fix(obj, dims, scale, offs):
ModuleNotFoundError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'
我已经通过以下步骤解决了这个问题:-
* 确保所有库都安装在基本根目录下
pip install darknetpy
在 base(root) 中借助 Anaconda Navigator 安装 Tensorflow
重启蟒蛇
我正在研究用于对象检测的暗网 yolov2。我使用了 pip install .
来编译 darkflow 库。之后当 darkflow 成功安装时。
from darkflow.net.build import TFNet
import cv2
options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}
tfnet = TFNet(options)
imgcv = cv2.imread("./sample_img/sample_dog.jpg")
result = tfnet.return_predict(imgcv)
print(result)
我遇到了这个错误。
C:\Users\IU-506\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
此外,这些也是错误,请查看:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-1bd33c7e6a6f> in <module>()
----> 1 from darkflow.net.build import TFNet
2 import cv2
3
4 options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}
5
~\Desktop\darkflow-master\darkflow\net\build.py in <module>()
5 from .ops import op_create, identity
6 from .ops import HEADER, LINE
----> 7 from .framework import create_framework
8 from ..dark.darknet import Darknet
9 import json
~\Desktop\darkflow-master\darkflow\net\framework.py in <module>()
----> 1 from . import yolo
2 from . import yolov2
3 from . import vanilla
4 from os.path import basename
5
~\Desktop\darkflow-master\darkflow\net\yolo\__init__.py in <module>()
1 from . import train
----> 2 from . import predict
3 from . import data
4 from . import misc
5 import numpy as np
~\Desktop\darkflow-master\darkflow\net\yolo\predict.py in <module>()
5 import os
6 import json
----> 7 from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
8
9 def _fix(obj, dims, scale, offs):
ModuleNotFoundError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'
我已经通过以下步骤解决了这个问题:-
* 确保所有库都安装在基本根目录下
pip install darknetpy
在 base(root) 中借助 Anaconda Navigator 安装 Tensorflow
重启蟒蛇