bzamecnik/ml

predict.py dropping different errors

Closed this issue · 2 comments

Hi! I'm trying to test prediction on wav and flac, but both of them drop me different errors: running wav file, I get

File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 98, in predict_class_label x_features = self.load_features(audio_file)
File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 135, in <module> print(model.predict_class_label(args.audio_file))
File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 87, in load_features
x_features = self.ch.transform(x0)
AttributeError: 'dict' object has no attribute 'transform'

and on flac file

Traceback (most recent call last): File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 135, in <module>
print(model.predict_class_label(args.audio_file))
File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 98, in predict_class_label
x_features = self.load_features(audio_file)
File "C:/dipl0m/ml-master/instrument-classification/predict.py", line 83, in load_features
x, fs = sf.read(audio_file)
File "C:\Users\jackb\AppData\Roaming\Python\Python36\site-packages\soundfile.py", line 374, in read
frames = f._prepare_read(start, stop, frames)
File "C:\Users\jackb\AppData\Roaming\Python\Python36\site-packages\soundfile.py", line 1447, in _prepare_read
self.seek(start, SEEK_SET)
File "C:\Users\jackb\AppData\Roaming\Python\Python36\site-packages\soundfile.py", line 870, in seek
_error_check(self._errorcode)
File "C:\Users\jackb\AppData\Roaming\Python\Python36\site-packages\soundfile.py", line 1455, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Internal psf_fseek() failed.

I'm using Python 3.6.2 on Windows and the model from here. Could you help me to figure out the issue?

Thanks for pointing out!