Repository: ray-project/ray

Issue:
[tune] HParams Dashboard shows no data when using Histogram Dashboard.
### What is your question?
<!--Please include [tune], [rllib], [autoscaler] etc. in the issue title if relevant-->
HParams dashboard shows no data when using Histogram dashboard.
![Screen Shot 2020-02-24 at 3 57 51 PM](https://user-images.githubusercontent.com/44219935/75191208-e6712980-571f-11ea-9349-f918e1a6f79b.png)

![Screen Shot 2020-02-24 at 3 57 33 PM](https://user-images.githubusercontent.com/44219935/75191225-ee30ce00-571f-11ea-9cd9-e0c765db0ef9.png)

*Ray version and other system information (Python version, TensorFlow version, OS):*
Ray version: 0.9.0.dev0
Python version: 3.7.5
TensorFlow version: 2.1.0

### Reproduction
I modified the [mnist_pytorch_trainable.py](https://github.com/ray-project/ray/blob/master/python/ray/tune/examples/mnist_pytorch_trainable.py) to log model parameters to tensorboad. 

Modification as follow:
```
def _train(self):
        train(self.model, self.optimizer, self.train_loader)
        acc = test(self.model, self.test_loader)
        result = {"mean_accuracy": acc}
        for tag, value in self.model.named_parameters():
                    tag = tag.replace('.', '/')
                    result[tag] = value.data.cpu().tolist()
        return result
```

If I removed the modification, the HParams dashboard is back to normal.
![Screen Shot 2020-02-24 at 4 12 08 PM](https://user-images.githubusercontent.com/44219935/75191712-ddcd2300-5720-11ea-8ab4-d0600b61f007.png)

Am I doing in the wrong way?



Discussion:

Resolving patch:
diff --git a/python/ray/tune/logger.py b/python/ray/tune/logger.py
--- a/python/ray/tune/logger.py
+++ b/python/ray/tune/logger.py
@@ -231,7 +231,12 @@ def flush(self):
     def close(self):
         if self._file_writer is not None:
             if self.trial and self.trial.evaluated_params and self.last_result:
-                self._try_log_hparams(self.last_result)
+                scrubbed_result = {
+                    k: value
+                    for k, value in self.last_result.items()
+                    if type(value) in VALID_SUMMARY_TYPES
+                }
+                self._try_log_hparams(scrubbed_result)
             self._file_writer.close()
 
     def _try_log_hparams(self, result):


Test patch:
diff --git a/python/ray/tune/tests/test_logger.py b/python/ray/tune/tests/test_logger.py
--- a/python/ray/tune/tests/test_logger.py
+++ b/python/ray/tune/tests/test_logger.py
@@ -8,12 +8,14 @@
 Trial = namedtuple("MockTrial", ["evaluated_params", "trial_id"])
 
 
-def result(t, rew):
-    return dict(
+def result(t, rew, **kwargs):
+    results = dict(
         time_total_s=t,
         episode_reward_mean=rew,
         mean_accuracy=rew * 2,
         training_iteration=int(t))
+    results.update(kwargs)
+    return results
 
 
 class LoggerSuite(unittest.TestCase):
@@ -31,22 +33,25 @@ def testCSV(self):
         logger = CSVLogger(config=config, logdir=self.test_dir, trial=t)
         logger.on_result(result(2, 4))
         logger.on_result(result(2, 4))
+        logger.on_result(result(2, 4, score=[1, 2, 3]))
         logger.close()
 
     def testJSON(self):
         config = {"a": 2, "b": 5}
         t = Trial(evaluated_params=config, trial_id="json")
         logger = JsonLogger(config=config, logdir=self.test_dir, trial=t)
-        logger.on_result(result(2, 4))
-        logger.on_result(result(2, 4))
+        logger.on_result(result(0, 4))
+        logger.on_result(result(1, 4))
+        logger.on_result(result(2, 4, score=[1, 2, 3]))
         logger.close()
 
     def testTBX(self):
         config = {"a": 2, "b": 5}
         t = Trial(evaluated_params=config, trial_id="tbx")
         logger = TBXLogger(config=config, logdir=self.test_dir, trial=t)
-        logger.on_result(result(2, 4))
-        logger.on_result(result(2, 4))
+        logger.on_result(result(0, 4))
+        logger.on_result(result(1, 4))
+        logger.on_result(result(2, 4, score=[1, 2, 3]))
         logger.close()