A technical migration guide — what changed, why it changed,
and what stayed exactly the same.
pycolmap 3.11.1 installed from the /kaggle/input/pycolmap3-11/ dataset.
cp312 upgrades to pycolmap 4.0.3 installed from a user notebook dataset, with a cp312-compiled wheel.
All MASt3R source paths are also migrated from /kaggle/input/mast3r-fix/ to /kaggle/input/notebooks/stpeteishii/mast3r-cp312/.
print(sys.version) is also added early on to explicitly verify the active Python version.
faiss-gpu-cu12 in a single command from the mast3r wheels folder.
cp312 installs three separate wheels explicitly — faiss_gpu_cu12, nvidia_cublas_cu12, and nvidia_cuda_runtime_cu12 — from a dedicated dataset, ensuring correct CUDA runtime linkage for cp312.
hamming, etc.) are built per Python version. cp312 adds explicit manual loading of the cp312-compiled .so files using importlib.util.spec_from_file_location, since the cp311 binaries cannot be used.
create_index is overridden to return a CPU IndexFlatL2, bypassing GPU initialization that fails in the cp312 environment.
(des, word_ids, image_ids) for build_ivf and 2-tuple (des, word_ids) for query_ivf, fixing an argument mismatch that would crash ASMK retrieval.
torch.load().
cp312 adds torch.serialization.add_safe_globals([argparse.Namespace]) before loading the MASt3R checkpoint, preventing a WeightsOnlyError that would occur silently in cp311's older torch version.
Database high-level API changed incompatibly, so cp311's approach of importing and calling the function from the external h5_to_db utility no longer works.
import_into_colmap from scratch using raw sqlite3:
cam_from_world was a plain attribute holding the pose object.
In pycolmap 4.x it became a method that returns the pose. The call site in reconstruct_from_db must be updated accordingly.
match_with_mast3r_and_save and potentially crashing downstream.
except block in run_one_dataset now calls traceback.print_exc() in addition to printing the error message string, making failures significantly easier to diagnose since the full stack trace is shown.
log() helper with sys.stdout.flush() and wraps every major step — import_into_colmap, run_verify_matches_safe, incremental_mapping — with entry/exit log lines. This makes it easy to pinpoint where a hang or crash occurs during reconstruction.
run_mast3r_pipeline reduces the thread pool from 2 workers to 1. With the heavier memory footprint of the cp312 stack (larger pycolmap, explicit CUDA wheels), running two datasets concurrently risks OOM errors on Kaggle's GPU instances.
| Area | cp311 | cp312 | Status |
|---|---|---|---|
| pycolmap | 3.11.1 (cp311 wheel) | 4.0.3 (cp312 wheel) | upgraded |
| FAISS install | single find-links install | 3 explicit wheel installs | upgraded |
| ASMK .so loading | implicit (cp311 binary) | explicit importlib loading | new |
| ASMK monkey-patches | none | FaissGpuL2Index + Codebook.quantize | new |
| torch.serialization | not needed | add_safe_globals([argparse.Namespace]) | new |
| import_into_colmap | h5_to_db helper | raw sqlite3 rewrite | rewritten |
| cam_from_world | .rotation (attribute) | ().rotation (method) | api break |
| Empty pair guard | absent | early-exit + skip message | improved |
| Error reporting | message only | message + traceback.print_exc() | improved |
| Reconstruct logging | minimal | step-by-step log() with flush | improved |
| ThreadPoolExecutor | max_workers=2 | max_workers=1 | reduced |
| MASt3R pipeline logic | identical — stages 1–4 unchanged | ✓ | |