Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix error "TypeError: 'zip' object is not subscriptable" in deepspeec… #17354

Merged
merged 1 commit into from
Jan 19, 2020
Merged

fix error "TypeError: 'zip' object is not subscriptable" in deepspeec… #17354

merged 1 commit into from
Jan 19, 2020

Conversation

moneypi
Copy link
Contributor

@moneypi moneypi commented Jan 17, 2020

…h.cfg training

Description

When traing speech_recognition by command python main.py --configfile deepspeech.cfg, I will get an error:
Traceback (most recent call last): File "main.py", line 299, in <module> data_train, data_val, args = load_data(args) File "main.py", line 173, in load_data save_feature_as_csvfile=save_feature_as_csvfile) File "/home/luke/tmp/mxnet/example/speech_recognition/stt_io_bucketingiter.py", line 105, in __init__ self.data[buck].append(self.trainDataList[i]) TypeError: 'zip' object is not subscriptable

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • All changes have test coverage:
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Comments

Just like file https://github.com/apache/incubator-mxnet/blob/master/example/speech_recognition/stt_io_iter.py, use the same logic:
self.trainDataList = list(zip(durations, audio_paths, texts))

Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of those py2 vs py3 changes right?
If run in py2 this example would have worked right? Else I'm curious as to why this example was not checked/tested at the time of introduction to the repo

@leezu
Copy link
Contributor

leezu commented Jan 19, 2020

@ChaiBapchya yes, it's a "Py3 only bug".

@leezu leezu merged commit 566905f into apache:master Jan 19, 2020
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants