lukas/ml-class

error in videos/seq2seq/train.py

alexandrovsky opened this issue · 1 comments

Hi, when I run train.py, I get the following error:

Traceback (most recent call last): File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 131, in <module> guess = ctable.decode(preds[0], calc_argmax=False) File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 41, in decode return ''.join(self.indices_char[x] for x in x) File "wandb-tutorials/ml-class/videos/seq2seq/train.py", line 41, in <genexpr> return ''.join(self.indices_char[x] for x in x) TypeError: unhashable type: 'numpy.ndarray'

Any ideas how to fix this?

The error occurs because a numpy.ndarray is being used as an index, which isn't allowed. To fix it, flatten the array and convert it to a list of indices before decoding. Adjust the decode method to handle numpy.ndarray correctly.