CPJKU / dcase_task2

Training General-Purpose Audio Tagging Networks with Noisy Labels and Iterative Self-Verification
https://cpjku.github.io/dcase_task2/
MIT License
29 stars 10 forks source link

ModuleNotFoundError: No module named 'dcase_task2' #5

Closed 842Mono closed 5 years ago

842Mono commented 5 years ago

Hello. I'm going through the code. I'm trying to run this command:

python3 self_verify.py --model models/vgg_gap_spec2.py --spec_dir specs_train_v2 --top_probs_thresh 0.95 --k_per_class 40 --no_len_fix --min_len 3000 --max_len 3000 --stochastic --train_file train_self_verified_it0.csv --tag it0

but I get this error:

Traceback (most recent call last):
  File "self_verify.py", line 10, in <module>
    from dcase_task2.lasagne_wrapper.network import Network
ModuleNotFoundError: No module named 'dcase_task2'

I also get it when I try running this train command:

python3 run_experiment_set.py --experiment_set pretrain
Traceback (most recent call last):
  File "run_experiment_set.py", line 5, in <module>
    from dcase_task2.lasagne_wrapper.utils import BColors
ModuleNotFoundError: No module named 'dcase_task2'
dmatte commented 5 years ago

Hi,

did you setup the project as in the README? python setup.py develop --user Another alternative would be to add the project directory to your PYTHONPATH.

Regards, Matthias

P.S.: By the way, I was developing the project with python 2.7. Unfortunately, I have not found the time yet to port and test it with python 3 so this might also cause compatibility problems.

842Mono commented 5 years ago

Thanks for the reply. I've made a new clone and I'm trying to run the project with python2.7.

Note that when running the line

python prepare_spectrograms.py --audio_path <DATA_ROOT>/audio_train --spec_path <DATA_ROOT>/specs_train_v1 --spec_version 1 --dump

librosa threw this error:

Traceback (most recent call last):
  File "prepare_spectrograms.py", line 9, in <module>
    import librosa
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/__init__.py", line 12, in <module>
    from . import core
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/core/__init__.py", line 104, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/core/time_frequency.py", line 10, in <module>
    from ..util.exceptions import ParameterError
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/util/__init__.py", line 67, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/util/utils.py", line 111, in <module>
    def valid_audio(y, mono=True):
  File "/home/mono/.local/lib/python2.7/site-packages/librosa/cache.py", line 49, in wrapper
    if self.cachedir is not None and self.level >= level:
  File "/home/mono/.local/lib/python2.7/site-packages/joblib/memory.py", line 918, in cachedir
    DeprecationWarning, stacklevel=2)
TypeError: expected string or buffer

which could be fixed by doing this:

pip install 'joblib==0.11' --force-reinstall
stefan-balke commented 5 years ago

I was setting up this repo yesterday with Anaconda and created an environment.yaml. It's actually a nightmare with the "old" Theano dependencies. You have to be really careful which numpy versions you take etc. Will push this tomorrow.

stefan-balke commented 5 years ago

I pushed the Anaconda env and added a line to the docs about Python 2.7.

Bumping librosa to 0.6.3 also resolves the issue with joblib.