Global name 'librosa' is not defined
Reagan1947 opened this issue · 5 comments
Sednn/mixture2clean_dnn/preparedata.py
def read_audio(path, target_fs=None):
(audio, fs) = soundfile.read(path)
if audio.ndim > 1:
audio = np.mean(audio, axis=1)
if target_fs is not None and fs != target_fs:
audio = librosa.resample(audio, orig_sr=fs, target_sr=target_fs)
fs = target_fs
return audio, fs
librosa
is not define, Should import pack librosa.- Moreover
librosa
will also causeTypeError: expected string or buffer
pip install 'joblib==0.11' --force-reinstall
will solve it.
Is import of "librosa" package a must? at preparedata.py
Yes, you must import librosa. Best wishes, Qiuqiang
…
________________________________ From: Reagan lee notifications@github.com Sent: 07 September 2019 13:03 To: yongxuUSTC/sednn sednn@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [yongxuUSTC/sednn] Global name 'librosa' is not defined (#47) Is import of "librosa" package a must? at preparedata.py — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FyongxuUSTC%2Fsednn%2Fissues%2F47%3Femail_source%3Dnotifications%26email_token%3DADFXTSLIC5WOMSZO76PX6K3QIOKC3A5CNFSM4ITMWCBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EXLSY%23issuecomment-529102283&data=02%7C01%7Cq.kong%40surrey.ac.uk%7C8e5485f97cda49a6a8e608d7338b77e9%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637034546414116986&sdata=4fSjvcL%2FiMsRyjHvCHZWpSfG5dLLNoctUvZMvRB%2FKkc%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADFXTSOVWSV3QNX2YSR6QTLQIOKC3ANCNFSM4ITMWCBA&data=02%7C01%7Cq.kong%40surrey.ac.uk%7C8e5485f97cda49a6a8e608d7338b77e9%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637034546414116986&sdata=SsPFpcosxFzXwvttK24LddVB1PmATkTy99Nbtkp7IFU%3D&reserved=0.
But i don't find in 'Sednn/mixture2clean_dnn/preparedata.py'