We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9129fd0 commit 88a0ce5Copy full SHA for 88a0ce5
examples/pytorch/image-classification/run_image_classification.py
@@ -43,6 +43,7 @@
43
HfArgumentParser,
44
Trainer,
45
TrainingArguments,
46
+ set_seed,
47
)
48
from transformers.trainer_utils import get_last_checkpoint
49
from transformers.utils import check_min_version, send_example_telemetry
@@ -214,6 +215,9 @@ def main():
214
215
"the `--output_dir` or add `--overwrite_output_dir` to train from scratch."
216
217
218
+ # Set seed before initializing model.
219
+ set_seed(training_args.seed)
220
+
221
# Initialize our dataset and prepare it for the 'image-classification' task.
222
if data_args.dataset_name is not None:
223
dataset = load_dataset(
0 commit comments