Skip to content

fix(utils): get_scheduler returns exception instead of (+3 more) - #93

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/utils-assorted-4d744e75
Open

fix(utils): get_scheduler returns exception instead of (+3 more)#93
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/utils-assorted-4d744e75

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

Small fixes in utils.py:

fix: get_scheduler returns exception instead of raising

Fix: Replace:

    else:
        return NotImplementedError('learning rate policy [%s] is not implemented', hyperparameters['lr_policy'])

with:

    else:
        raise NotImplementedError('learning rate policy [%s] is not implemented' % hyperparameters['lr_policy'])

fix: load_vgg16 uses load_lua and Vgg16 without imports

Fix: Replace:

import torch.nn.init as init
import time

with:

import torch.nn.init as init
import time
from torch.utils.serialization import load_lua
from networks import Vgg16

fix: get_model_list crashes when no matching checkpoints

Fix: Replace:

    if gen_models is None:
        return None
    gen_models.sort()

with:

    if not gen_models:
        return None
    gen_models.sort()

fix: load_vgg16 uses undefined load_lua and Vgg16 symbols

Fix: Replace:

import time
# Methods

with:

import time
try:
    from torch.utils.serialization import load_lua
except ImportError:
    load_lua = None
from vgg import Vgg16
# Methods

Files changed

  • utils.py

@andrewwhitecdw
andrewwhitecdw marked this pull request as ready for review August 3, 2026 22:10
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

Successfully merging this pull request may close these issues.

1 participant