mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Fix callback default (horror bug!) (#1534)
* fix horror bug * update changelog * fix doctest * liine too long
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
- Added a missing call to the `on_before_zero_grad` model hook ([#1493](https://github.com/PyTorchLightning/pytorch-lightning/pull/1493)).
|
||||
|
||||
-
|
||||
- Fixed a bug that caused the `callbacks` Trainer argument to reference a global variable ([#1534](https://github.com/PyTorchLightning/pytorch-lightning/pull/1534)).
|
||||
|
||||
|
||||
## [0.7.3] - 2020-04-09
|
||||
|
||||
@@ -87,7 +87,7 @@ class Trainer(
|
||||
logger: Union[LightningLoggerBase, Iterable[LightningLoggerBase], bool] = True,
|
||||
checkpoint_callback: Union[ModelCheckpoint, bool] = True,
|
||||
early_stop_callback: Optional[Union[EarlyStopping, bool]] = False,
|
||||
callbacks: List[Callback] = [],
|
||||
callbacks: Optional[List[Callback]] = None,
|
||||
default_root_dir: Optional[str] = None,
|
||||
gradient_clip_val: float = 0,
|
||||
process_position: int = 0,
|
||||
@@ -293,7 +293,7 @@ class Trainer(
|
||||
"""
|
||||
|
||||
# Init callbacks
|
||||
self.callbacks = callbacks
|
||||
self.callbacks = callbacks or []
|
||||
self.on_init_start()
|
||||
|
||||
# benchmarking
|
||||
@@ -546,7 +546,10 @@ class Trainer(
|
||||
(<class 'int'>, typing.Dict[int, int], typing.List[list]),
|
||||
1),
|
||||
...
|
||||
('callbacks', (<class 'pytorch_lightning.callbacks.base.Callback'>,), []),
|
||||
('callbacks',
|
||||
(typing.List[pytorch_lightning.callbacks.base.Callback],
|
||||
<class 'NoneType'>),
|
||||
None),
|
||||
('check_val_every_n_epoch', (<class 'int'>,), 1),
|
||||
...
|
||||
('max_epochs', (<class 'int'>,), 1000),
|
||||
|
||||
Reference in New Issue
Block a user