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

运行video_demo.py时,只有第一帧预测正确后面都是nan,也就是后面没有预测框 #138

Open
mastergao57 opened this issue Mar 13, 2022 · 1 comment

Comments

@mastergao57
Copy link

mastergao57 commented Mar 13, 2022

有没有朋友遇到同样问题?我在运行video_demo.py时,只有第一帧预测正确后面都是nan。我怀疑是utils.load_weights(model, "./yolov3.weights")这一句的问题,于是把这一句放到了while true里,如代码所示,结果预测正确,但视频速度非常慢了,因为每次都要加载一次权重,我不知道该怎么修改def load_weights(model, weights_file)。求助!

model = tf.keras.Model(input_layer, bbox_tensors)
utils.load_weights(model, "./yolov3.weights")
#model.summary()
vid = cv2.VideoCapture(video_path)
while True:
#utils.load_weights(model, "./yolov3.weights")
return_value, frame = vid.read()
if return_value:
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
else:
raise ValueError("No image!")

@iamrulai
Copy link

遇到同样的问题

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