Conversation
Inferer.infer() catches its own exception, prints the traceback and returns None; main() then unpacked that None and announced 'cannot unpack non-iterable NoneType object' as the failure. Exit code was already 1 (ScrollPrize#1360 cause 3), but the message pointed at the wrong thing. Treat a None result as the failure it is and say so. Refs ScrollPrize#1360 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@ge-al is attempting to deploy a commit to the scroll Team on Vercel. A member of the Team first needs to authorize it. |
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In one sentence: When
vesuvius.predictfails inside inference, the CLI now says so and names the error, instead of reportingcannot unpack non-iterable NoneType object.One real example: Starting with the public
scrollprize/surface_recto_versocheckpoint laid out as downloaded from Hugging Face (checkpoint_final.pthat the model root, nofold_0/), I ranvesuvius.predict --model_path … --input_dir s3://vesuvius-challenge-open-data/PHerc1447/volumes/20250521151220-8.640um-1.2m-116keV-masked.zarr --input_anon --bbox 4900:5156,3600:3824,4100:4356 --device cpu, and the run ended with a message about the missing checkpoint instead of an unpacking error.Before:
The exit code is already 1 on
main(cause 3 of #1360 is fixed), but the headline error is the wrong one:Inferer.infer()catches its own exception, prints it, and returnsNone, andmain()unpacks thatNone.After this PR:
Proof: the before block is the verbatim tail of my run on
23adee0; the after block is the same command on this branch. Testtests/models/run/test_inference_main_failure.pydrivesmain()with anInfererwhoseinfer()fails the way the real one does and asserts exit 1, the original error in the output, and no "cannot unpack". While here, measured on the same data that #1360's causes 1 and 2 are already fixed onmainunder zarr 3.2.1: with the checkpoint infold_0/,vesuvius.predictcreateslogits_part_0.zarrandcoordinates_part_0.zarrand runs (Created zarr array … shape (64, 4, 256, 224, 256)).Why / where this is useful: anyone driving
vesuvius.predictfrom a script or a sweep gets the actual cause in the last lines of the log, which is where they look first.Details
Refs #1360 (causes 1–2 measured fixed on
main; cause 3's exit code was already 1; this makes the message match). Measured at23adee0, macOS, Python 3.14, zarr 3.2.1;main()still unpacks theNoneon currentmain, and the branch is rebased onto2dcfaf6(tests/models/run: 57 passed). Opened as a draft only because of the three-open-PR limit for outside contributors (#1743); it is ready for review.Written with Claude Code as a coding assistant, directed and reviewed by me.