Skip to content

solver.recover() calls resolve_checkpoints() with 4 args but signature accepts 1 — resume broken in 1.1.3 #23

Description

@michaela10c

Summary

On flyvis 1.1.3 (latest on PyPI), resuming a partially-trained network fails with a TypeError. MultiTaskSolver.recover() calls resolve_checkpoints() with four positional arguments, but the installed resolve_checkpoints() signature accepts only one. This makes resume=true unusable.

Environment

  • flyvis: 1.1.3 (latest available on PyPI; versions are 1.1.1, 1.1.2, 1.1.3)
  • Python: 3.12
  • Install: pip
  • Platform: Google Colab, T4 GPU

The mismatch (static, no training required)

resolve_checkpoints signature (from flyvis/utils/chkpt_utils.py):

(networkdir: flyvis.network.NetworkDir) -> flyvis.utils.chkpt_utils.Checkpoints

But MultiTaskSolver.recover() in flyvis/solver.py calls it with four arguments:

checkpoints = resolve_checkpoints(
    self.dir, checkpoint, validation_subdir, loss_file_name
)

This can be confirmed without running any training:

import flyvis, inspect
from flyvis.utils.chkpt_utils import resolve_checkpoints
print("flyvis", flyvis.__version__)
print("resolve_checkpoints:", inspect.signature(resolve_checkpoints))
src = inspect.getsource(flyvis.solver.MultiTaskSolver.recover)
print([l.strip() for l in src.splitlines() if "resolve_checkpoints" in l])

Runtime error (on resume=true)

TypeError: resolve_checkpoints() takes 1 positional argument but 4 were given
  File ".../flyvis/solver.py", line 598, in recover
    checkpoints = resolve_checkpoints(
                  ^^^^^^^^^^^^^^^^^^^^

Steps to reproduce

# 1. Train a network to a checkpoint
flyvis train-single ensemble_and_network_id=<id> task_name=flow train=true \
  resume=false task.n_iters=4000 network.connectome.file=<file>

# 2. Resume with the SAME n_iters
flyvis train-single ensemble_and_network_id=<id> task_name=flow train=true \
  resume=true task.n_iters=4000 network.connectome.file=<file>
# -> TypeError above

Expected behavior

recover() resolves the requested checkpoint and resumes training from it.

Note on the fix

recover() uses checkpoint.index, checkpoints.index, checkpoints.indices, and checkpoints.path after the call, so the fix likely requires resolve_checkpoints() to return a Checkpoints object that selects the requested checkpoint — i.e. the caller and callee need to be brought back into sync on the intended API, not just an arity change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions