GitHub issue #5306: Can't use custom feature description when loading a dataset
State: closed | Created: 2022-11-28T07:55:44Z

### Describe the bug

I have created a feature dictionary to describe my datasets' column types, to use when loading the dataset, following [the doc](https://huggingface.co/docs/datasets/main/en/about_dataset_features). It crashes at dataset load.


### Steps to reproduce the bug

```python
# Creating features
task_list = [f"motif_G{i}" for i in range(19, 53)]

features = {t: Sequence(feature=Value(dtype="float64")) for t in task_list}
for col_name in ["class_label"]:
    features[col_name] = Sequence(feature=Value(dtype="int64"))
for col_name in ["num_nodes"]:
    features[col_name] = Value(dtype="int64")
for col_name in ["num_bridges", "num_cycles", "avg_shortest_path_len"]:
    features[col_name] = Sequence(feature=Value(dtype="float64"))
for col_name in ["edge_attr", "node_feat", "edge_index"]:
    features[col_name] = Sequence(feature=Sequence(feature=Value(dtype="int64")))
print(features)

dataset = load_dataset(path=f"graphs-datasets/unbalanced-motifs-500K", split="train", features=features)
```

Last line will crash and say 'TypeError: argument of type 'Sequence' is not iterable'. 

Full stack:
```
Traceback (most recent call last):
  File "pretrain_tokengt.py", line 131, in <module>
    main(output_folder = "../workspace/pretraining",
  File "pretrain_tokengt.py", line 52, in main
    dataset = load_dataset(path=f"graphs-datasets/{dataset_name}", split="train", features=features)
  File "huggingface_env/lib/python3.8/site-packages/datasets/load.py", line 1718, in load_dataset
    builder_instance = load_dataset_builder(
  File "huggingface_env/lib/python3.8/site-packages/datasets/load.py", line 1514, in load_dataset_builder
    builder_instance: DatasetBuilder = builder_cls(
  File "huggingface_env/lib/python3.8/site-packages/datasets/builder.py", line 321, in __init__
    info.update(self._info())
  File "huggingface_env/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 62, in _info
    return datasets.DatasetInfo(features=self.config.features)
  File "<string>", line 20, in __init__
  File "huggingface_env/lib/python3.8/site-packages/datasets/info.py", line 155, in __post_init__
    self.features = Features.from_dict(self.features)
  File "huggingface_env/lib/python3.8/site-packages/datasets/features/features.py", line 1599, in from_dict
    obj = generate_from_dict(dic)
  File "huggingface_env/lib/python3.8/site-packages/datasets/features/features.py", line 1282, in generate_from_dict
    return {key: generate_from_dict(value) for key, value in obj.items()}
  File "huggingface_env/lib/python3.8/site-packages/datasets/features/features.py", line 1282, in <dictcomp>
    return {key: generate_from_dict(value) for key, value in obj.items()}
  File "huggingface_env/lib/python3.8/site-packages/datasets/features/features.py", line 1281, in generate_from_dict
    if "_type" not in obj or isinstance(obj["_type"], dict):
TypeError: argument of type 'Sequence' is not iterable
```

### Expected behavior

For it not to crash.

### Environment info

- `datasets` version: 2.7.1
- Platform: Linux-5.14.0-1054-oem-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3