question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vaihingen datamodule

See original GitHub issue

Description

I would expect that with a existing Vaihingen datamodule, I only need to define a segmentation task and a pl.Trainer to train a model on this dataset (but maybe this expectation is wrong). However, the Vaihingen dataset has variable sized image dimensions, and therefore one cannot specify a batch_size>1 because otherwise tensors cannot be stacked. So either there should be a collate function for the dataloaders in the datamodule or some comment in the documentation because the default batch_size of the datamodule is 64.

Steps to reproduce

from torchgeo.datamodules import Vaihingen2DDataModule
from torchgeo.trainers import SemanticSegmentationTask
import pytorch_lightning as pl

datamodule = Vaihingen2DDataModule(root="./data/Vaihingen")

task = SemanticSegmentationTask(
    segmentation_model="unet",
    encoder_name="resnet18",
    encoder_weights="imagenet",
    in_channels=3,
    num_classes=6,
    loss="jaccard",
    ignore_index=None,
    learning_rate=0.001,
    learning_rate_schedule_patience=5
)

trainer = pl.Trainer(
    fast_dev_run=True,
    enable_progress_bar=False
)

trainer.fit(
    model=task,
    datamodule=datamodule
)

Version

0.4.0.dev0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
calebrob6commented, Oct 15, 2022

They aren’t georeferenced

1reaction
calebrob6commented, Oct 15, 2022

There are 16 samples in the training dataset and they are more like “tiles” or “scenes”. I think the datamodule should randomly sample fixed size crops from them.

The sizes:

torch.Size([3, 2569, 1919])
torch.Size([3, 2566, 1893])
torch.Size([3, 2558, 2818])
torch.Size([3, 2565, 1919])
torch.Size([3, 1281, 2336])
torch.Size([3, 2546, 1903])
torch.Size([3, 2546, 1903])
torch.Size([3, 1783, 2995])
torch.Size([3, 2567, 1917])
torch.Size([3, 3007, 2006])
torch.Size([3, 2563, 1934])
torch.Size([3, 2555, 1980])
torch.Size([3, 2555, 1388])
torch.Size([3, 1995, 1996])
torch.Size([3, 2557, 1887])
torch.Size([3, 2557, 1887])
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Vaihingen datamodule #853 - microsoft/torchgeo - GitHub
This PR closes #851. As suggested, based on the OSCDDatamodule, random patch crops are taken during training. For validation and testing the ...
Read more >
torchgeo.datamodules - Read the Docs
LightningDataModule implementation for the Chesapeake CVPR Land Cover dataset. Uses the random splits defined per state to partition tiles into train, val, and ......
Read more >
Module:Adjacent stations/Stuttgart S-Bahn - Wikipedia
This is a data module for Module:Adjacent stations. It supports services operated by Stuttgart S-Bahn. LinesEdit. Line, Keys, Color, Hex ...
Read more >
Understanding PyTorch Lightning DataModules
DataModule is a reusable and shareable class that encapsulates the DataLoaders along with the steps required to process data.
Read more >
ADA146251.pdf - DTIC
synchronous operation of the LSTDM with the multirate digital data module in the AN/FCC-98 and CY-104 will also be implemented. In higher levels...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found