Created
September 13, 2023 14:09
-
-
Save Tob-iee/6ade51ce140f743a14ebc110ffc358d2 to your computer and use it in GitHub Desktop.
Load DETR's object detection model and specify your hyperparameters for the model's training.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Training the DETR model | |
model = AutoModelForObjectDetection.from_pretrained( | |
checkpoint, | |
id2label=id2label, | |
label2id=label2id, | |
ignore_mismatched_sizes=True, | |
) | |
training_args = TrainingArguments( | |
output_dir="detr-resnet-50_finetuned_cppe5", | |
# overwrite_output_dir= , | |
per_device_train_batch_size=8, | |
num_train_epochs=40, | |
fp16=False, | |
save_steps=200, | |
logging_steps=10, | |
learning_rate=1e-5, | |
weight_decay=1e-4, | |
save_total_limit=2, | |
remove_unused_columns=False, | |
push_to_hub=False, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment