weecology / weecology/DeepForest
Add seperate config for predict batch size and train batch size.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 774
- Forks
- 265
- PR merge metrics
- No merged PRs in 30d
Description
Updating model weights takes alot more GPU memory than just a forward model pass.
predict.tile is slower than it needs to be because its using trainer.predict, which inherits a dataloader with batch size set by the global config https://github.com/weecology/DeepForest/blob/3dbc8342de766f1f504d3c2da69c1fbc2443da42/src/deepforest/main.py#L348
and in train gets from load_dataset.
the default is 1 because training is unknown size GPU (probably should be 2)
- Make a predict_batch_size and a train_batch_size config arg
- Update defaults to 2 for train and 8 for predict.
- update the config doc
- Write tests showing the dataloaders of each are yielding correct sizes.
I'm unsure about the val dataloader batch size, maybe should be higher, not clear to me the GPU memory. I think val batch size should be the predict size, since no weights are updated.
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 in src/deepforest/main.py around the dataloader setup at lines 335 and 348, then trace how the global batch-size config reaches training and prediction. Add separate train and predict settings with the requested defaults, resolve whether validation follows prediction, update the config documentation, and add tests that verify each dataloader batch size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, machine-learning, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100