owo12321 / Yolov5_DeepSort_Traffic-counter

基于Yolov5_DeepSort的物体计数器,可以统计车流或人流量等
157 stars 26 forks source link

请问为什么会出现这种错误?是缺少什么文件吗? #16

Open ZareAlucard opened 11 months ago

ZareAlucard commented 11 months ago

File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\count.py", line 457, in detect(args) File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\count.py", line 330, in detect outputs = deepsort.update(xywhs, confss, im0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\deep_sort.py", line 31, in update detections = [Detection(bbox_tlwh[i], conf, features[i]) for i, conf in enumerate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\deep_sort.py", line 31, in detections = [Detection(bbox_tlwh[i], conf, features[i]) for i, conf in enumerate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\sort\detection.py", line 30, in init self.tlwh = np.asarray(tlwh, dtype=np.float) ^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\venv\Lib\site-packages\numpy__init.py", line 319, in getattr raise AttributeError(former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

owo12321 commented 11 months ago

File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\count.py", line 457, in detect(args) File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\count.py", line 330, in detect outputs = deepsort.update(xywhs, confss, im0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\deep_sort.py", line 31, in update detections = [Detection(bbox_tlwh[i], conf, features[i]) for i, conf in enumerate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\deep_sort.py", line 31, in detections = [Detection(bbox_tlwh[i], conf, features[i]) for i, conf in enumerate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\deep_sort_pytorch\deep_sort\sort\detection.py", line 30, in init self.tlwh = np.asarray(tlwh, dtype=np.float) ^^^^^^^^ File "D:\数学建模\Yolov5_DeepSort_Traffic-counter-main\venv\Lib\site-packages\numpyinit.py", line 319, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

看错误提示里有说的,应该是numpy新版本弃用了np.float,试下把numpy版本改成1.18.5 pip3 install numpy==1.18.5