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

运行test.py只有第一张图片有测试结果,剩下的图片都没有检测框出现 #122

Open
taojianggit opened this issue May 7, 2021 · 3 comments

Comments

@taojianggit
Copy link

taojianggit commented May 7, 2021

把test.py里的
model.load_weights("checkpoint/yolov3_debris")
移动到
for num, line in enumerate(annotation_file):
循环内可以测试所有图片。

但这明显不是根本原因,不知道哪位大神知道原因?

@taojianggit
Copy link
Author

又行了,估计是因为电脑内存不够的原因,重启下就好了

@JialiangHan
Copy link

我把model.predict() 改成了model(image_data)在test.py 82行

@mastergao57
Copy link

mastergao57 commented Mar 14, 2022

我也是类似的问题。我在运行video_demo.py时,只有第一帧预测正确后面都是nan。我怀疑是utils.load_weights(model, "./yolov3.weights")这一句的问题,于是把这一句放到了while True里,如代码所示,结果预测正确,但视频速度非常慢了,因为每次都要加载一次权重。然后我就按您所说的改成model(image_data)就可以了,但速度肯定没有model.predict(image_data)model.predict_on_batch(image_data)快。我怀疑是tensorflow版本的问题,我是2.7.0,gtx1070。或许这就是个bug.不能用model.predict()进行循环操作。别人也有类似的问题。Successive prediction (loop) in keras model generate NaN values

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

3 participants