Repository: wandb/wandb

Issue:
fastai: wandb not logging fastai validation loss with default args
`wandb --version && python --version && uname`

* Weights and Biases version: 0.8.5
* Python version: 3.7.3
* Operating System: Linux
* fast.ai version: 1.0.55

### Description

When you use the `fastai` callback `WandbCallback` with the default arguments you get some errors and the validation loss is not logged.

### What I Did

1. Run the following code in a jupyter notebook
```
import wandb
import fastai
from wandb.fastai import WandbCallback
from fastai.vision import *
from functools import partial
print(f'wandb version: {wandb.__version__}, fastai version: {fastai.__version__}')
wandb.init(project="fastai-test")
path = untar_data(URLs.MNIST_SAMPLE)
data = ImageDataBunch.from_folder(path)
learn = cnn_learner(data, models.resnet18, metrics=accuracy, callback_fns=WandbCallback)
learn.fit_one_cycle(1, 1e-2)
```

2. You'll get the following error:

![image](https://user-images.githubusercontent.com/38154/61618701-b7d63080-acb0-11e9-9eb1-9de4addaa9cd.png)

```
/home/fastai/anaconda3/envs/wandbtest/lib/python3.7/site-packages/fastai/callbacks/tracker.py:50: UserWarning: <class 'wandb.fastai.WandbCallback'> conditioned on metric `val_loss` which is not available. Available metrics are: train_loss, valid_loss, accuracy
  warn(f'{self.__class__} conditioned on metric `{self.monitor}` which is not available. Available metrics are: {", ".join(map(str, self.learn.recorder.names[1:-1]))}')
```

3. To fix it you can tell it to monitor `valid_loss` by changing the callback to be:

``` python
learn = cnn_learner(data, models.resnet18, metrics=accuracy, callback_fns=partial(WandbCallback, monitor='valid_loss'))
```

I'm guessing that the name of the loss changed with fast.ai at some point.



Discussion:
Issue-Label Bot is automatically applying the label `bug` to this issue, with a confidence of 0.73. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! 

 Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/wandb/client) and [code](https://github.com/hamelsmu/MLapp) for this bot.
We'll take a look this week

Resolving patch:
diff --git a/wandb/fastai/__init__.py b/wandb/fastai/__init__.py
--- a/wandb/fastai/__init__.py
+++ b/wandb/fastai/__init__.py
@@ -29,6 +29,7 @@
         learn.fit(..., callbacks=WandBCallback(learn, ...))
 '''
 import wandb
+import fastai
 from fastai.callbacks import TrackerCallback
 from pathlib import Path
 import random
@@ -49,7 +50,7 @@ def __init__(self,
                  learn,
                  log="gradients",
                  save_model=True,
-                 monitor='val_loss',
+                 monitor=None,
                  mode='auto',
                  input_type=None,
                  validation_data=None,
@@ -63,7 +64,7 @@ def __init__(self,
             learn (fastai.basic_train.Learner): the fast.ai learner to hook.
             log (str): "gradients", "parameters", "all", or None. Losses & metrics are always logged.
             save_model (bool): save model at the end of each epoch.
-            monitor (str): metric to monitor for saving best model.
+            monitor (str): metric to monitor for saving best model. None uses default TrackerCallback monitor value.
             mode (str): "auto", "min" or "max" to compare "monitor" values and define best model.
             input_type (str): "images" or None. Used to display sample predictions.
             validation_data (list): data used for sample predictions if input_type is set.
@@ -76,7 +77,11 @@ def __init__(self,
                 'You must call wandb.init() before WandbCallback()')
 
         # Adapted from fast.ai "SaveModelCallback"
-        super().__init__(learn, monitor=monitor, mode=mode)
+        if monitor is None:
+            # use default TrackerCallback monitor value
+            super().__init__(learn, mode=mode)
+        else:
+            super().__init__(learn, monitor=monitor, mode=mode)
         self.save_model = save_model
         self.model_path = Path(wandb.run.dir) / 'bestmodel.pth'
 


Test patch: