Lightning-AI / Lightning-AI/pytorch-lightning
Comet: Undocumented and incorrectly described function
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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