Skip to content

Commit

Permalink
Merge branch 'master' into feature/672_EMNISTDataModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Aug 13, 2021
2 parents c6adbae + 2d7ae88 commit ef13456
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 88 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/ci_install-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ jobs:

- name: Create package
run: |
# python setup.py check --metadata --strict
python setup.py sdist
pip install cython setuptools wheel
python setup.py sdist bdist_wheel
- name: Install package
if: runner.os != 'windows'
working-directory: ./dist
run: |
pip install virtualenv
virtualenv vEnv ; source vEnv/bin/activate
# pip install -r requirements.txt
pip install torchvision matplotlib
pip install dist/*
cd .. & python -c "import pytorch_lightning as pl ; print(pl.__version__)"
cd .. & python -c "import pl_bolts ; print(pl_bolts.__version__)"
deactivate ; rm -rf vEnv
pip install $(python -c "import glob ; pkg = glob.glob('*.whl')[0] ; print(pkg)")
python -c "import pl_bolts ; print(pl_bolts.__version__)"
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Changed the default values `pin_memory=False`, `shuffle=False` and `num_workers=16` to `pin_memory=True`, `shuffle=True` and `num_workers=0` of datamodules ([#701](https://github.com/PyTorchLightning/lightning-bolts/pull/701))


### Deprecated

Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/binary_mnist_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: Union[int, float] = 0.2,
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
8 changes: 4 additions & 4 deletions pl_bolts/datamodules/cifar10_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: Union[int, float] = 0.2,
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down Expand Up @@ -148,7 +148,7 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: int = 50,
num_workers: int = 16,
num_workers: int = 0,
num_samples: int = 100,
labels: Optional[Sequence] = (1, 5, 8),
*args: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/cityscapes_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def __init__(
data_dir: str,
quality_mode: str = 'fine',
target_type: str = 'instance',
num_workers: int = 16,
num_workers: int = 0,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/fashion_mnist_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: Union[int, float] = 0.2,
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/imagenet_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def __init__(
meta_dir: Optional[str] = None,
num_imgs_per_val_class: int = 50,
image_size: int = 224,
num_workers: int = 16,
num_workers: int = 0,
batch_size: int = 32,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/kitti_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def __init__(
data_dir: Optional[str] = None,
val_split: float = 0.2,
test_split: float = 0.1,
num_workers: int = 16,
num_workers: int = 0,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/mnist_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: Union[int, float] = 0.2,
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
4 changes: 2 additions & 2 deletions pl_bolts/datamodules/sklearn_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def __init__(
y_test=None,
val_split=0.2,
test_split=0.1,
num_workers=2,
num_workers=0,
random_state=1234,
shuffle=True,
batch_size: int = 16,
pin_memory=False,
pin_memory=True,
drop_last=False,
*args,
**kwargs,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/ssl_imagenet_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def __init__(
self,
data_dir: str,
meta_dir: Optional[str] = None,
num_workers: int = 16,
num_workers: int = 0,
batch_size: int = 32,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/stl10_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def __init__(
data_dir: Optional[str] = None,
unlabeled_val_split: int = 5000,
train_val_split: int = 500,
num_workers: int = 16,
num_workers: int = 0,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/vision_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def __init__(
self,
data_dir: Optional[str] = None,
val_split: Union[int, float] = 0.2,
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
batch_size: int = 32,
seed: int = 42,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
6 changes: 3 additions & 3 deletions pl_bolts/datamodules/vocdetection_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ def __init__(
self,
data_dir: str,
year: str = "2012",
num_workers: int = 16,
num_workers: int = 0,
normalize: bool = False,
shuffle: bool = False,
pin_memory: bool = False,
shuffle: bool = True,
pin_memory: bool = True,
drop_last: bool = False,
*args: Any,
**kwargs: Any,
Expand Down
41 changes: 0 additions & 41 deletions tests/datamodules/test_imports.py

This file was deleted.

0 comments on commit ef13456

Please sign in to comment.