Division by zero when training with small datasets caused by incomplete batch dropping

Aperta
#228 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia da robosat/tools/train.py, in particolare dalla divisione alla riga 197 e dall’inizializzazione di DataLoader intorno alle righe 273-274. Riproduci l’addestramento con un dataset più piccolo di un batch, quindi verifica che gli ultimi batch incompleti vengano mantenuti e che l’addestramento non fallisca più per una divisione per zero.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I am aware that this repo is no longer maintained but I recently had to blow the dust off of it to replicate some stuff I did a few years ago. When setting up the environment I kept getting a division by 0 here. I finally resolved it and thought I should leave a note here in case anyone finds themself in a similar situation.

It turns out it was because I was using a trivially small datasetr (only a few features) because I was just trying to get the entire pipeline working correctly. Specifically, when initializing the DataLoaders, the drop_last parameter is hardcoded to True, which will always drop the last batch if it is incomplete. So if you only have one (tiny) batch, you end up with an empty data loader, causing the aforementioned division by zero error.

Change this parameter to False here and here to fix it.

Lingua principale
Python
Stelle
2.1k
Fork
384
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mapbox/robosat

Tutte le issue di mapbox/robosat

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.