Lightning-AI / Lightning-AI/pytorch-lightning

Comet: Undocumented and incorrectly described function

Open
#20,583 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3rd party docs logger: comet
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

The Comet function `log_model` has no formal documentation and what little is written is _wrong_. None of the Comet examples include this function.

See [logger.experiment.log_model(name="my-model", "path to your model")](https://github.com/Lightning-AI/pytorch-lightning/blob/ea59e403367871a782becc5c327d7bafbd43bf8c/src/lightning/pytorch/loggers/comet.py#L163)

## The correct function definition:
```Python
logger.experiment.log_model(name="my-model", file_or_folder="")
```

## A working example
Assuming Trainer `enable_checkpointing` is `True`:
```Python
class DNN(pl.LightningModule):
def __init__(self):
...
on_train_end(self):
self.logger.experiment.log_model(
name="",
file_or_folder=self.trainer.checkpoint_callback.last_model_path,
)
```

cc @lantiga @borda

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/lightning/pytorch/loggers/comet.py at the log_model entry point referenced in the issue, then locate the related documentation and examples. Update the description and examples to use file_or_folder and the checkpoint path shown; done means the function is formally documented and no longer described incorrectly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.