Skip to content
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

结果发生越界问题 #122

Open
Ichiruchan opened this issue May 13, 2024 · 3 comments
Open

结果发生越界问题 #122

Ichiruchan opened this issue May 13, 2024 · 3 comments

Comments

@Ichiruchan
Copy link

Ichiruchan commented May 13, 2024

和其他人员的项目联调时发生了,
企业微信截图_1715599680997
越界的错误。m_output_objects_host + bi * (m_param.topK * m_output_objects_width + 1))[0]是个十分大的数,导致int后为-46,用size_t接住查看为 18446744073709551570。但是单独执行我的项目时,无越界状况发生,这种情况下如何判断

@FeiYull
Copy link
Owner

FeiYull commented May 16, 2024

@Ichiruchan 把越界时,那几个变量全部打印出来,同时把图片缓存下,单独调试,很可能是前面的问题导致m_output_objects_host值异常

@Ichiruchan
Copy link
Author

我将图片缓存了下来然后立即读取,在完整的合作项目中会发生越界,而存下来的图在单独的ai推理项目中正常执行且整套流程应该是没有并行的租借读写显存的

@Ichiruchan
Copy link
Author

查到问题所在了,我这里由于每次推理的图片大小不一致,yolo对象是多次构造析构的,相当于yolo.reset()并没有用,导致AtomicAdd加在了一个随机值上,(虽然我不明白为什么第一次cudaMalloc的时候没有发生这种问题?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants