Skip to content

fix run_name format in tutorial notebooks and add missing dataset/model properties#99

Merged
CuriousDolphin merged 10 commits into
mainfrom
minor-fixes
Jun 6, 2025
Merged

fix run_name format in tutorial notebooks and add missing dataset/model properties#99
CuriousDolphin merged 10 commits into
mainfrom
minor-fixes

Conversation

@CuriousDolphin
Copy link
Copy Markdown
Member

@CuriousDolphin CuriousDolphin commented Jun 5, 2025

Minor Fixes

  • Fixed run_name format standardization: Updated all training examples to use f"{model.name}_{train_dataset.name}" pattern consistently
  • Added missing properties: Implemented name and task properties in MapDataset class and name property in FocoosModel class
  • Fixed notebook cell types: Changed raw cells to code cells in training and inference tutorials for proper execution
  • Updated documentation: Improved comments for sync_to_hub parameter and training configuration examples
  • Minor notebook improvements: Updated dataset listing format and removed empty markdown cells
  • Updated default export runtime type from ONNX_CUDA32 to TORCHSCRIPT_32
  • Reload Processor in focoos models before training start
  • Sync model weights after best_checkpoint restore
  • Fix osx broken installation on new sh releases

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2025

Coverage

Tests Skipped Failures Errors Time
221 0 💤 0 ❌ 0 🔥 19.369s ⏱️

@CuriousDolphin CuriousDolphin changed the title Minor Fixes Fix run_name format in tutorial notebooks and add missing dataset/model properties Jun 5, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@CuriousDolphin CuriousDolphin changed the title Fix run_name format in tutorial notebooks and add missing dataset/model properties fix run_name format in tutorial notebooks and add missing dataset/model properties Jun 5, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Sync Issue on Successful Training

The after_train method now only syncs training results and artifacts to the hub when an exception occurs. This is because the sync logic was moved inside the exception handling block (if exc_type is not None). As a result, successful training completion does not trigger the final sync.

focoos/trainer/hooks/sync_to_hub.py#L71-L104

exc_type, exc_value, exc_traceback = sys.exc_info()
if exc_type is not None:
logger.error(
f"Exception during training, status set to TRAINING_ERROR: {str(exc_type.__name__)} {str(exc_value)}"
)
status = ModelStatus.TRAINING_ERROR
self.model_info.status = status
if self.model_info.training_info is not None:
self.model_info.training_info.main_status = status
self.model_info.training_info.failure_reason = str(exc_value)
self.model_info.training_info.end_time = datetime.now().isoformat()
if self.model_info.training_info.status_transitions is None:
self.model_info.training_info.status_transitions = []
self.model_info.training_info.status_transitions.append(
dict(
status=status,
timestamp=datetime.now().isoformat(),
detail=f"{str(exc_type.__name__)}: {str(exc_value)}",
)
)
self.model_info.dump_json(os.path.join(self.output_dir, ArtifactName.INFO))
self._sync_train_job(
sync_info=HubSyncLocalTraining(
status=status,
iterations=self.iteration,
training_info=self.model_info.training_info,
),
upload_artifacts=[
ArtifactName.WEIGHTS,
ArtifactName.LOGS,
ArtifactName.INFO,
ArtifactName.METRICS,
],
)

Fix in Cursor


Bug: Refactoring Error: Unhandled `None` in Iteration

The refactored logic in visualizer.py introduces a TypeError: 'NoneType' object is not iterable when the classes argument is None. The new else branch attempts to iterate over classes ([str(i) for i in classes]) when it is None, whereas the original code correctly handled this case by not attempting to process classes if it was None.

focoos/utils/visualizer.py#L489-L493

labels = None
if classes is not None and class_names is not None:
labels = [class_names[i] if i < len(class_names) else str(i) for i in classes]
else:
labels = [str(i) for i in classes]

Fix in Cursor


BugBot free trial expires on June 12, 2025
Your team has used $0.00 of the $50.00 spend limit so far. Team admins can manage spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

Copy link
Copy Markdown
Contributor

@giuseppeambrosio97 giuseppeambrosio97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CuriousDolphin CuriousDolphin merged commit c0b1431 into main Jun 6, 2025
10 checks passed
@CuriousDolphin CuriousDolphin deleted the minor-fixes branch June 6, 2025 16:35
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.

[SyncToHub] upload model weights after checkpointer restore [trainer] broken visualizer hook on instance segmentation dataset

2 participants