ageron / ageron/handson-ml2

[Chap 16] TypeError: '_NestedVariant' object is not subscriptable

Offen
#271 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Jupyter Notebook
Sterne
30k
Forks
13.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

In chapter 16 notebook running this cell:

```
batch_size = 32
dataset = dataset.shuffle(10000).batch(batch_size)
dataset = dataset.map(lambda windows: (windows[:, :-1], windows[:, 1:]))
```

produces this error in Colab:

```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
6 batch_size = 32
7 dataset = dataset.shuffle(10000).batch(batch_size)
----> 8 dataset = dataset.map(lambda windows: (windows[:, :-1], windows[:, 1:]))

10 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs)
256 except Exception as e: # pylint:disable=broad-except
257 if hasattr(e, 'ag_error_metadata'):
--> 258 raise e.ag_error_metadata.to_exception(e)
259 else:
260 raise

TypeError: in user code:

:8 None *
dataset = dataset.map(lambda windows: (windows[:, :-1], windows[:, 1:]))

TypeError: '_NestedVariant' object is not subscriptable
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.