Skip to content
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

"out of memory" during validation #60

Open
domYuki opened this issue Sep 4, 2020 · 0 comments
Open

"out of memory" during validation #60

domYuki opened this issue Sep 4, 2020 · 0 comments

Comments

@domYuki
Copy link

domYuki commented Sep 4, 2020

When performing validation for each Epoch, "out of memory" occurs after validation.

You should add "with torch.no_grad():" before "output = model(input)" in tool/train.py on line 359.

Before

    model.eval()
    end = time.time()
    for i, (input, target) in enumerate(val_loader):
        data_time.update(time.time() - end)
        input = input.cuda(non_blocking=True)
        target = target.cuda(non_blocking=True)
        output = model(input)

Fixed

    model.eval()
    end = time.time()
    for i, (input, target) in enumerate(val_loader):
        data_time.update(time.time() - end)
        input = input.cuda(non_blocking=True)
        target = target.cuda(non_blocking=True)
        with torch.no_grad():
               output = model(input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant