anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: tensorflow/federated
Issue: Error in loading the GLDv2 dataset

Hello! Thanks for the fantastic library. I have run into an error while loading the GLDv2 dataset via TFF. 

Please see the snippet below:
```
>>> import tensorflow_federated as tff
>>> dataset = tff.simulation.datasets.gldv2.load_data()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/to/python3.8/site-packages/tensorflow_federated/python/simulation/datasets/gldv2.py", line 396, in load_data
    qh = logging.handlers.QueueHandler(q)
AttributeError: module 'logging' has no attribute 'handlers'
```

## The root cause of this error
The error appears to be because of a missing import in `gldv2.py`. We can isolate this error to the following lines which occur within `gldv2.py`. Compare this snippet which does not work
```
>>> import logging, multiprocessing
>>> q = multiprocessing.Queue(-1)
>>> qh = logging.handlers.QueueHandler(q)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'logging' has no attribute 'handlers'
```
to this one which does
```
>>> import logging, multiprocessing
>>> import logging.handlers            # Add this import statement
>>> q = multiprocessing.Queue(-1)
>>> qh = logging.handlers.QueueHandler(q)  # works!
```

## Fixing the error
Adding an import statement `import logging.handlers` in `gldv2.py` fixes the issue -- I've tested this out locally. I can send a pull request. 

**Environment (please complete the following information):**
* OS Platform and Distribution: Ubuntu 20.04
* Python package versions (e.g., TensorFlow Federated, TensorFlow): TFF: 0.19.0 and TF: 2.5.0. The same error also occurs in the nightly version: TFF: 0.19.0.dev20210821 and TF: 2.7.0-dev20210822.
* Python version: 3.8
* Bazel version (if building from source): N/A (installed via pip)
* CUDA/cuDNN version: N/A
* What TensorFlow Federated execution stack are you using? simulation 


**Expected behavior**
I expect the data to be loaded correctly.



Changed files:
tensorflow_federated/python/simulation/datasets/gldv2.py

diff --git a/tensorflow_federated/python/simulation/datasets/gldv2.py b/tensorflow_federated/python/simulation/datasets/gldv2.py
index ac782fb4..ec76f694 100644
--- a/tensorflow_federated/python/simulation/datasets/gldv2.py
+++ b/tensorflow_federated/python/simulation/datasets/gldv2.py
@@ -15,6 +15,7 @@
 
 import collections
 import logging
+import logging.handlers
 import multiprocessing.pool
 import os
 import shutil
Repository: tensorflow/federated
Issue: `tff.learning.from_keras_model` does not accept subclassed Keras model

**Describe the bug**
`tff.learning.from_keras_model()` does not accept subclassed keras model. See this [colab](https://colab.research.google.com/drive/1dPJlo3e6vVHXS9O4Pm3_Qq2c_h0VtRaP?usp=sharing).

**Environment (please complete the following information):**
* OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Colab
* Python package versions (e.g., TensorFlow Federated, TensorFlow): Colab TF-nightly TFF-nightly
* Python version: python 3.6
* Bazel version (if building from source): N/A
* CUDA/cuDNN version: N/A
* What TensorFlow Federated execution stack are you using? N/A

**Expected behavior**
`tff.learning.from_keras_model()` properly accepts subclassed keras model, or provide info on the doc if this is not possible?

**Additional context**
The issue seems to be due to `from_keras_model()` consuming `tf.keras.model.output` (see [pointer](https://github.com/tensorflow/federated/blob/v0.16.1/tensorflow_federated/python/learning/keras_utils.py#L260)) which is not written when the model is subclassed.

Changed files:
tensorflow_federated/python/learning/keras_utils.py

diff --git a/tensorflow_federated/python/learning/keras_utils.py b/tensorflow_federated/python/learning/keras_utils.py
index 1d9a8a9b..51ecfe95 100644
--- a/tensorflow_federated/python/learning/keras_utils.py
+++ b/tensorflow_federated/python/learning/keras_utils.py
@@ -51,6 +51,11 @@ def from_keras_model(
   which the generated `tff.learning.Model` will appear, TFF needs the type `y`
   in addition to the type `x`.
 
+  Note: This function does not currently accept subclassed `tf.keras.Models`,
+  as it makes assumptions about presence of certain attributes which are
+  guaranteed to exist through the functional or Sequential API but are
+  not necessarily present for subclassed models.
+
   Args:
     keras_model: A `tf.keras.Model` object that is not compiled.
     loss: A single `tf.keras.losses.Loss` or a list of losses-per-output. If a