Repository: catalyst-team/catalyst

Issue:
Cannot train SupervisedWandbRunner
Catalyst 20.2
Reproducible example:
```
from catalyst import dl
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset

X = torch.rand(16, 10)
y = torch.rand(X.shape[0])
model = nn.Linear(X.shape[1], 1)
dataset = TensorDataset(X, y)
loader = DataLoader(dataset, batch_size=8)
loaders = {
    'train': loader,
    'valid': loader
}
runner = dl.SupervisedWandbRunner()

runner.train(
    model=model,
    loaders=loaders,
    criterion=nn.MSELoss(),
    optimizer=optim.Adam(model.parameters()),
    logdir='LOG',
    monitoring_params={
        'project': "yt",
        'group': "aa"
    }
)
```

After the whole training process I get an exception:
```
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-279a2ce060b8> in <module>
     24     monitoring_params={
     25         'project': "yt",
---> 26         'group': "aa"
     27     }
     28 )

~/.local/lib/python3.6/site-packages/catalyst/dl/runner/supervised.py in train(self, model, criterion, optimizer, loaders, logdir, callbacks, scheduler, resume, num_epochs, valid_loader, main_metric, minimize_metric, verbose, state_kwargs, checkpoint_data, fp16, monitoring_params, check)
    204             monitoring_params=monitoring_params
    205         )
--> 206         self.run_experiment(experiment, check=check)
    207 
    208     def infer(

~/.local/lib/python3.6/site-packages/catalyst/contrib/dl/runner/wandb.py in run_experiment(self, experiment, check)
    141         self._pre_experiment_hook(experiment=experiment)
    142         super().run_experiment(experiment=experiment, check=check)
--> 143         self._post_experiment_hook(experiment=experiment)
    144 
    145 

~/.local/lib/python3.6/site-packages/catalyst/contrib/dl/runner/wandb.py in _post_experiment_hook(self, experiment)
    104 
    105         checkpoint_paths = []
--> 106         for glob in self.checkpoints_glob:
    107             checkpoint_paths.extend(list(checkpoints_src.glob(glob)))
    108         checkpoint_paths = list(set(checkpoint_paths))

TypeError: 'NoneType' object is not iterable
```


Discussion:

Resolving patch:
diff --git a/catalyst/contrib/dl/runner/wandb.py b/catalyst/contrib/dl/runner/wandb.py
--- a/catalyst/contrib/dl/runner/wandb.py
+++ b/catalyst/contrib/dl/runner/wandb.py
@@ -64,7 +64,7 @@ def _pre_experiment_hook(self, experiment: Experiment):
         log_on_epoch_end: bool = \
             monitoring_params.pop("log_on_epoch_end", True)
         checkpoints_glob: List[str] = \
-            monitoring_params.pop("checkpoints_glob", None)
+            monitoring_params.pop("checkpoints_glob", [])
         self._init(
             log_on_batch_end=log_on_batch_end,
             log_on_epoch_end=log_on_epoch_end,
diff --git a/catalyst/rl/core/sampler.py b/catalyst/rl/core/sampler.py
--- a/catalyst/rl/core/sampler.py
+++ b/catalyst/rl/core/sampler.py
@@ -113,8 +113,7 @@ def _init(self, **kwargs):
         if WANDB_ENABLED:
             if self.monitoring_params is not None:
                 self.checkpoints_glob: List[str] = \
-                    self.monitoring_params.pop(
-                        "checkpoints_glob", ["best.pth", "last.pth"])
+                    self.monitoring_params.pop("checkpoints_glob", [])
 
                 wandb.init(**self.monitoring_params)
             else:
diff --git a/catalyst/rl/core/trainer.py b/catalyst/rl/core/trainer.py
--- a/catalyst/rl/core/trainer.py
+++ b/catalyst/rl/core/trainer.py
@@ -100,8 +100,7 @@ def _init(self, **kwargs):
         if WANDB_ENABLED:
             if self.monitoring_params is not None:
                 self.checkpoints_glob: List[str] = \
-                    self.monitoring_params.pop(
-                        "checkpoints_glob", ["best.pth", "last.pth"])
+                    self.monitoring_params.pop("checkpoints_glob", [])
 
                 wandb.init(**self.monitoring_params)
 


Test patch: