Skip to content

Commit

Permalink
import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfulu committed Nov 21, 2023
1 parent 035e65d commit c7585c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pvnet/data/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import torch
from torch.utils.data import DataLoader
from torch.utils.data.datapipes.datapipe import IterDataPipe
from torch.utils.data.datapipes.iter import FileLister
from torch.utils.data.datapipes._decorator import functional_datapipe

from lightning.pytorch import LightningDataModule
Expand Down Expand Up @@ -184,7 +185,6 @@ def train_dataloader(self):
datapipe = self._get_premade_batches_datapipe("train", shuffle=True)
else:
datapipe = self._get_datapipe(*self.train_period)
rs = MultiProcessingReadingService(**self.readingservice_config)
return DataLoader(datapipe, **self._common_dataloader_kwargs)

def val_dataloader(self):
Expand Down
4 changes: 3 additions & 1 deletion scripts/save_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@

import hydra
import torch
from torch.utils.data import DataLoader
from torch.utils.data.datapipes.datapipe import IterDataPipe
from ocf_datapipes.training.pvnet import pvnet_datapipe
from ocf_datapipes.utils.utils import stack_np_examples_into_batch
from omegaconf import DictConfig, OmegaConf
from sqlalchemy import exc as sa_exc
from torch.utils.data import DataLoader

from tqdm import tqdm

from pvnet.data.datamodule import batch_to_tensor
Expand Down
4 changes: 3 additions & 1 deletion scripts/save_concurrent_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import hydra
import numpy as np
import torch
from torch.utils.data import DataLoader
from torch.utils.data.datapipes.datapipe import IterDataPipe
from ocf_datapipes.training.common import (
open_and_return_datapipes,
)
Expand All @@ -31,7 +33,7 @@
from ocf_datapipes.utils.utils import stack_np_examples_into_batch
from omegaconf import DictConfig, OmegaConf
from sqlalchemy import exc as sa_exc
from torch.utils.data import DataLoader

from tqdm import tqdm

from pvnet.data.datamodule import batch_to_tensor
Expand Down

0 comments on commit c7585c7

Please sign in to comment.