Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions rfdetr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def export(self, output_dir="output", infer_dir=None, simplify=False, backbone_
input_names = ['input']
output_names = ['features'] if backbone_only else ['dets', 'labels']
dynamic_axes = None
self.model.eval()
model.eval()
with torch.no_grad():
if backbone_only:
features = model(input_tensors)
Expand Down Expand Up @@ -562,7 +562,6 @@ def export(self, output_dir="output", infer_dir=None, simplify=False, backbone_
print(f"Successfully simplified ONNX model to: {sim_output_file}")

print("ONNX export completed successfully")
self.model = self.model.to(device)


if __name__ == '__main__':
Expand Down Expand Up @@ -1059,4 +1058,4 @@ def populate_args(
gradient_checkpointing=gradient_checkpointing,
**extra_kwargs
)
return args
return args