When users run EMUSES on a previously trained model folder and change the --prediction_optim_dict parameter, the training crashes due to parameter space conflicts in Optuna studies.
- Run EMUSES training with
--prediction_optim_dict optim_dict_predict - Let it complete some trials (creates SQLite study databases)
- Rerun with
--prediction_optim_dict optim_dict_ae(different parameter space) - Training crashes when Optuna tries to sample parameters that don't exist in the new space
EMUSES should handle parameter space changes gracefully, either by:
- Creating new studies for the new parameter space, or
- Providing clear options to the user about how to proceed
Application crashes with Optuna parameter sampling errors when trying to resume studies with incompatible parameter spaces.
Study Name Collision + Parameter Space Mismatch:
- Study names remain the same:
f"{target_tag}_fold_{fold}" - But parameter space definition changes between optim dicts
- Optuna's
load_if_exists=Truetries to continue with incompatible parameters - Results in sampling errors when new dict doesn't contain parameters from stored trials
Code Locations:
- Study creation:
emuses/tools/optuna_cv.py:166-182 - Parameter loading:
emuses/pipelines/heatmap_stage.py:115-130
Implement simple conflict detection and resolution:
- Detect conflicts early in HeatmapStage initialization
- Check optim dict compatibility before study creation
- Provide user-friendly resolution options:
- Create new timestamped study folder
- Option to overwrite existing studies
- Auto-handling for non-interactive/GUI modes
# 1. Conflict detection
def check_optim_dict_compatibility(output_folder, new_optim_dict_name, target_tag):
# Check for existing studies and compare optim dict names
# 2. Resolution handling (CLI + future GUI compatible)
def handle_optim_dict_conflict(output_folder, new_optim_dict_name, context):
# Provide appropriate options based on interaction mode
# 3. Metadata tracking
def save_optim_dict_metadata(output_folder, optim_dict_name):
# Track which optim dict was used for future conflict detection- CLI Interactive: Prompt user with clear options
- CLI Non-interactive: Auto-create timestamped folder
- Future GUI: Silent auto-handling with notification
- ✅ Prevents crashes completely
- ✅ Preserves user work (existing studies)
- ✅ GUI/CLI compatible design
- ✅ Early detection = fast feedback
- ✅ Simple implementation (low risk)
emuses/pipelines/heatmap_stage.py: Add conflict detectionemuses/utils/: New conflict resolution utilities- Tests: Add conflict scenario coverage
- Small changes to existing pipeline flow
- No changes to core Optuna usage
- Minimal testing complexity
Progressive Parameter Space Evolution: Dynamically modify Optuna studies to support parameter space changes while preserving trials.
Rejected because:
- High implementation complexity (3x code, 5x testing)
- Marginal performance gains (1-3% for significant complexity)
- Research software context prioritizes reliability over optimization sophistication
- EMUSES parameter spaces are relatively small (~8-12 parameters)
Medium - Affects user experience when experimenting with different parameter spaces, but workaround exists (delete existing studies manually).
bug- crashes on parameter changesenhancement- improve user experiencegood first issue- clear scope, well-defined solution
Detailed analysis and technical specifications available in: docs/issues/optim_dict_resume_conflict.md