Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpc stl-10 finetune fix #173

Merged
merged 10 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enable dp tests
  • Loading branch information
williamFalcon committed Aug 28, 2020
commit f04f05680101f97d7136530cbd27ee9b420ebe25
9 changes: 9 additions & 0 deletions pl_bolts/models/self_supervised/cpc/cpc_finetuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ def cli_main(): # pragma: no-cover
dm.val_transforms = CPCEvalTransformsSTL10()
dm.test_transforms = CPCEvalTransformsSTL10()

def to_device(batch, device):
import pdb; pdb.set_trace()
(_, _), (x, y) = batch
x = x.to(device)
y = y.to(device)
return x, y

dm.transfer_batch_to_device = to_device

# finetune
tuner = SSLFineTuner(backbone, in_features=backbone.z_dim, num_classes=backbone.num_classes)
trainer = pl.Trainer.from_argparse_args(args, early_stop_callback=True)
Expand Down
9 changes: 0 additions & 9 deletions pl_bolts/models/self_supervised/simclr/simclr_finetuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ def cli_main(): # pragma: no-cover
dm.train_transforms = SimCLRTrainDataTransform(h)
dm.val_transforms = SimCLREvalDataTransform(h)

def to_device(batch, device):
import pdb; pdb.set_trace()
(_, _), (x, y) = batch
x = x.to(device)
y = y.to(device)
return x, y

dm.transfer_batch_to_device = to_device

elif args.dataset == 'imagenet2012':
dm = ImagenetDataModule.from_argparse_args(args, image_size=196)
(c, h, w) = dm.size()
Expand Down