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

fix for pytorch_lightning >= 1.0.0 #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Here are the [results](https://github.com/AntixK/PyTorch-VAE/blob/master/README.
### Requirements
- Python >= 3.5
- PyTorch >= 1.3
- Pytorch Lightning >= 0.6.0 ([GitHub Repo](https://github.com/PyTorchLightning/pytorch-lightning/tree/deb1581e26b7547baf876b7a94361e60bb200d32))
- Pytorch Lightning >= 1.0.0 ([GitHub Repo](https://github.com/PyTorchLightning/pytorch-lightning/tree/deb1581e26b7547baf876b7a94361e60bb200d32))
- CUDA enabled computing device

### Installation
Expand Down Expand Up @@ -60,7 +60,7 @@ exp_params:

trainer_params:
gpus: 1
max_nb_epochs: 50
max_epochs: 50
gradient_clip_val: 1.5
.
.
Expand Down
13 changes: 6 additions & 7 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from experiment import VAEXperiment
import torch.backends.cudnn as cudnn
from pytorch_lightning import Trainer
from pytorch_lightning.logging import TestTubeLogger
from pytorch_lightning.loggers import TestTubeLogger


parser = argparse.ArgumentParser(description='Generic runner for VAE models')
Expand Down Expand Up @@ -42,14 +42,13 @@
config['exp_params'])

runner = Trainer(default_save_path=f"{tt_logger.save_dir}",
min_nb_epochs=1,
min_epochs=1,
logger=tt_logger,
log_save_interval=100,
train_percent_check=1.,
val_percent_check=1.,
flush_logs_every_n_steps=100,
limit_train_batches=1.,
limit_val_batches=1.,
num_sanity_val_steps=5,
early_stop_callback = False,
**config['trainer_params'])

print(f"======= Training {config['model_params']['name']} =======")
runner.fit(experiment)
runner.fit(experiment)