在执行tensorRT推理的时候出现了错误,详细信息如下:
D:cvConNext_demotesttrt.py:32: DeprecationWarning: Use set_optimization_profile_t.active_optimization_profile = 0
Traceback (most recent call last):File "D:cvConNext_demotesttrt.py", line 37, in <module>d_input = _alloc(image.nbytes) # 分配输入的内存。
pycuda._driver.LogicError: explicit_context_dependent failed: invalid device context - no currently active context?
这是pycuda没有初始化,执行初始化即可:
import pycuda.driver as cuda
import pycuda.autoinit
import pycuda.autoinit 这行是灰色的,给人的感觉是没有用,但是如果没有这句话就会报上面的错误。
本文发布于:2024-02-01 09:48:17,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170675209735775.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |