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

Modified data_load.py for considering python version #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions data_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from utils import *
import codecs
import re
import os
import os, sys
import unicodedata

def load_vocab():
Expand Down Expand Up @@ -104,8 +104,12 @@ def get_batch():
if hp.prepro:
def _load_spectrograms(fpath):
fname = os.path.basename(fpath)
mel = "mels/{}".format(fname.replace("wav", "npy"))
mag = "mags/{}".format(fname.replace("wav", "npy"))
if sys.version_info[0] == 3:
mel = "mels/{}".format(fname.decode().replace("wav", "npy"))
mag = "mags/{}".format(fname.decode().replace("wav", "npy"))
else:
mel = "mels/{}".format(fname.replace("wav", "npy"))
mag = "mags/{}".format(fname.replace("wav", "npy"))
return fname, np.load(mel), np.load(mag)

fname, mel, mag = tf.py_func(_load_spectrograms, [fpath], [tf.string, tf.float32, tf.float32])
Expand Down