ageron / ageron/handson-ml2

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

Aperta
#271 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
30k
Fork
13.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.