Skip to content

imagenet: fix typo addressing args.gpu #1361

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

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion imagenet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def run_validate(loader, base_progress=0):
i = base_progress + i
if use_accel:
if args.gpu is not None and device.type=='cuda':
torch.accelerator.set_device_index(argps.gpu)
torch.accelerator.set_device_index(args.gpu)
images = images.cuda(args.gpu, non_blocking=True)
target = target.cuda(args.gpu, non_blocking=True)
else:
Expand Down
1 change: 1 addition & 0 deletions run_python_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function imagenet() {
cp sample/train/n/* sample/val/n/
fi
uv run main.py --epochs 1 sample/ || error "imagenet example failed"
uv run main.py --epochs 1 --gpu 0 sample/ || error "imagenet example failed"
}

function language_translation() {
Expand Down