Skip to content

多线程调用模型进行测试 #46

@sunpu1995

Description

@sunpu1995

ValueError: Tensor Tensor("lambda_1/map/TensorArrayStack/TensorArrayGatherV3:0", shape=(?, ?, 6), dtype=float32) is not an element of this graph.

当我使用一下代码进行测试的时候出现这个错误,
hat_cfg = PPYOLO_2x_Config()
hat_detector = PPYOLO_2x_Hat(hat_cfg, use_gpu=True)
video_path = cfg.video_path

def main():
# ----------------------------------------视频处理------------------------------------------
cap = cv2.VideoCapture(video_path)
print('load ' + video_path)
print('---------------------------')
index = 0
while True:
print(index)
ret, frame = cap.read()
if not ret:
break
if index % cfg.sample_interval != 0:
index += 1
continue
_, hat_output_box = hat_detector.detect_image(frame) # 安全帽检测
print(hat_output_box)
index+=1

if name == 'main':
for i in range(3):
threading.Thread(target=main).start()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions