-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yolov7 trt.py推理报错 #15
Comments
检查一下类别数对不对 |
ok,解决了 |
|
您好,请问您是怎么解决这个问题的,请给我一个解决方案 |
在yolov7里面把yolo.py的返回值改了,按照建议的那样。还有就是现在暂时不支持端到端检测,好像也会报这个错误 |
报错信息:
/home/zmw/anaconda3/envs/yolov7/lib/python3.7/site-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order)
Traceback (most recent call last):
File "/home/zmw/tensorrt-python/yolov7/trt.py", line 30, in
origin_img = pred.inference(img_path, conf=0.3)
File "/home/zmw/tensorrt-python/utils/utils.py", line 87, in inference
predictions = np.reshape(data, (1, -1, int(5+self.n_classes)))[0]
File "<array_function internals>", line 6, in reshape
File "/home/zmw/anaconda3/envs/yolov7/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 299, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/home/zmw/anaconda3/envs/yolov7/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 55, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/home/zmw/anaconda3/envs/yolov7/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 44, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
ValueError: cannot reshape array of size 4 into shape (1,newaxis,85)
完全跟着指导走的,不知道这里要怎么修改代码
The text was updated successfully, but these errors were encountered: