Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attribute error byte object have no attribute read in train.py #115

Open
mehulGupta7991 opened this issue Jan 30, 2019 · 1 comment
Open

Comments

@mehulGupta7991
Copy link

No description provided.

@ThiagoFPMR
Copy link

You didn't give a detailed description so I can't be sure if we were facing the same exact error. But at some point when the code ran in my machine, it turned the strings containing the paths to the MFCC files into b strings, which is what prompted the attribute error.

I fixed the issue by decoding those strings back into UTF-8 after loading them in the _load_mfcc() function of the data.py file.

@tf.sg_producer_func
def _load_mfcc(src_list):

    # label, wave_file
    label, mfcc_file = src_list
    mfcc_file = mfcc_file.decode(encoding='UTF-8')

    # decode string to integer
    label = np.fromstring(label, np.int)

    # load mfcc
    mfcc = np.load(mfcc_file, allow_pickle=False)

    # speed perturbation augmenting
    mfcc = _augment_speech(mfcc)

    return label, mfcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants