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

Update engine.py #2187

Merged
merged 1 commit into from
May 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions references/detection/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ def evaluate(model, data_loader, device):
iou_types = _get_iou_types(model)
coco_evaluator = CocoEvaluator(coco, iou_types)

for image, targets in metric_logger.log_every(data_loader, 100, header):
image = list(img.to(device) for img in image)
for images, targets in metric_logger.log_every(data_loader, 100, header):
images = list(img.to(device) for img in images)
targets = [{k: v.to(device) for k, v in t.items()} for t in targets]

torch.cuda.synchronize()
model_time = time.time()
outputs = model(image)
outputs = model(images)

outputs = [{k: v.to(cpu_device) for k, v in t.items()} for t in outputs]
model_time = time.time() - model_time
Expand Down