Skip to content

Commit

Permalink
fix error about img size
Browse files Browse the repository at this point in the history
  • Loading branch information
HDThang committed Sep 10, 2024
1 parent b2acd77 commit 9976d9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/pytorch/image-pretraining/run_mae.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ def main():
image_processor = ViTImageProcessor.from_pretrained(model_args.model_name_or_path, **config_kwargs)
else:
image_processor = ViTImageProcessor()

config.update({
"image_size": image_processor.size["height"],
})
# create model
if model_args.model_name_or_path:
model = ViTMAEForPreTraining.from_pretrained(
Expand All @@ -296,6 +298,7 @@ def main():
cache_dir=model_args.cache_dir,
revision=model_args.model_revision,
token=model_args.token,
force_download=True,
)
else:
logger.info("Training new model from scratch")
Expand Down Expand Up @@ -334,7 +337,6 @@ def main():
Normalize(mean=image_processor.image_mean, std=image_processor.image_std),
]
)

def preprocess_images(examples):
"""Preprocess a batch of images by applying transforms."""

Expand Down

0 comments on commit 9976d9f

Please sign in to comment.