DCASE-REPO / dcase2018_baseline

DCASE 2018 Baseline systems
MIT License
128 stars 78 forks source link

Task 4: TypeError: load() got an unexpected keyword argument 'res_type' #5

Closed danstowell closed 6 years ago

danstowell commented 6 years ago

Task 4 - now I'm trying with Python 3.5, using virtualenv. (I don't use conda on my machine, and I won't be installing it any time soon, so I'm doing it all via pip and venv.) I'm afraid I get a rather confusing error, at least it has a backtrace this time:

100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 271/271 [01:16<00:00,  3.54it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:08<00:00,  1.17it/s]
  0%|                                                                                                                                                               | 0/37545 [00:00
    sys.exit(main(parameters))
  File "task4_crnn.py", line 96, in main
    os.path.join("dataset", "audio", "test")
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/site-packages/dcase_util/datasets/datasets.py", line 569, in initialize
    self.extract_packages()
  File "/home/dans/dev/github/dcase2018_baseline/task4/Dataset_dcase2018.py", line 124, in extract_packages
    missing_files = download(package.get('filename'), result_audio_directory, n_jobs=3)
  File "dataset/download_data.py", line 153, in download
    for val in tqdm(p.imap_unordered(download_file_alias, filenames, chunk_size), total=len(filenames)):
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/site-packages/tqdm/_tqdm.py", line 941, in __iter__
    for obj in iterable:
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 314, in 
    return (item for chunk in result for item in chunk)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 695, in next
    raise value
TypeError: load() got an unexpected keyword argument 'res_type'
Exception ignored in: 
Traceback (most recent call last):
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/site-packages/tqdm/_tqdm.py", line 879, in __del__
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/site-packages/tqdm/_tqdm.py", line 1098, in close
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/site-packages/tqdm/_tqdm.py", line 438, in _decr_instances
  File "/home/dans/dev/github/dcase2018_baseline/task4/venv3/lib/python3.5/_weakrefset.py", line 109, in remove
KeyError: 
turpaultn commented 6 years ago

Your error is not very meaningful for me at that time. I suggest two things: 1) It can come from multiprocessing package, so could you change: In Dataset_dcase2018.py, line 121 n_jobs=3 to n_jobs=1 please ? 2) It seems to come from unlabel_out_of_domain data in particular, did you have the same error on an other file ? If no, can you launch download_data.py (in "dataset" folder) commenting lines from 218 to 221 in the main please?

danstowell commented 6 years ago

Thanks.

  1. If I set n_jobs=1 the same 'res_type'error happens (but of course the backtrace looks different since no multiprocessing)
  2. I don't have the problem on other files, no. If I comment out 218-221 then download_data.py it completes happily. Here's a strange thing though: if I comment out 203-217 (i.e. only downloading that last dataset) it does not crash after item 10. (It's currently still downloading that dataset. I'll let you know if it completes.)

AHA I found the source of the error message: it's because my version of librosa is too old. I have 0.5.1 but librosa.load() added the res_type argument in 0.6. I'll check tomorrow whether the script completes, and I'll let you know.

turpaultn commented 6 years ago

Thanks for your complete answer. Did the version of librosa solve the issue ? In both cases, I should probably add the version of librosa in the readme.

toni-heittola commented 6 years ago

There was apparently incorrect librosa version in the requirements of dcase_util. This will be fix in the next pip release in a couple of days. For now best option is to add it to the readme.

danstowell commented 6 years ago

Updating librosa fixes this issue

danstowell commented 6 years ago

Closing this issue, since the fix is in https://github.com/DCASE-REPO/dcase_util/commit/ab8b537ce3e7dc02f697b4bbebd3c9c1ac0e8735