Coder Social home page Coder Social logo

prep_fsd.py problems about psla HOT 4 OPEN

yuangongnd avatar yuangongnd commented on May 27, 2024
prep_fsd.py problems

from psla.

Comments (4)

YuanGongND avatar YuanGongND commented on May 27, 2024

do you have sox installed? if no, please do so.

It isn't complex, you can debug it.

resample_cnt = 0
set_list = ['dev', 'eval']
for set in set_list:
basepath = fsd_path + '/FSD50K.'+ set +'_audio/'
targetpath = fsd_path + '/FSD50K.'+ set +'_audio_16k/'
if os.path.exists(targetpath) == False:
os.mkdir(targetpath)
files = get_immediate_files(basepath)
for audiofile in files:
os.system('sox ' + basepath + audiofile+' -r 16000 ' + targetpath + audiofile + '> /dev/null 2>&1')
resample_cnt += 1
if resample_cnt % 1000 == 0:
print('Resampled {:d} samples.'.format(resample_cnt))
print('Resampling finished.')
print('--------------------------------------------')

from psla.

aandreysr avatar aandreysr commented on May 27, 2024

I think I got a better indication of what might be wrong. When running the run.sh, it calls ../../src/run.sh and shows the following error, despite having installed the requirements.txt. I'm using Python 3.7.7 via SSH

+ export TORCH_HOME=./
+ TORCH_HOME=./
+ att_head=4
+ model=efficientnet
+ psla=True
+ eff_b=2
+ batch_size=24
+ '[' True == True ']'
+ impretrain=True
+ freqm=48
+ timem=192
+ mixup=0.5
+ bal=True
+ lr=5e-4
+ p=mean
+ '[' mean == median ']'
+ trpath=./datafiles/fsd50k_tr_full_type1_2_mean.json
+ epoch=40
+ wa_start=21
+ wa_end=40
+ lrscheduler_start=10
+ exp_dir=./exp/demo-efficientnet-2-5e-4-fsd50k-impretrain-True-fm48-tm192-mix0.5-bal-True-b24-lemean-2
+ mkdir -p ./exp/demo-efficientnet-2-5e-4-fsd50k-impretrain-True-fm48-tm192-mix0.5-bal-True-b24-lemean-2
+ CUDA_CACHE_DISABLE=1
+ python ../../src/run.py --data-train ./datafiles/fsd50k_tr_full_type1_2_mean.json --data-val ./datafiles/fsd50k_val_full.json --data-eval ./datafiles/fsd50k_eval_full.json --exp-dir ./exp/demo-efficientnet-2-5e-4-fsd50k-impretrain-True-fm48-tm192-mix0.5-bal-True-b24-lemean-2 --n-print-steps 1000 --save_model True --num-workers 32 --label-csv ./class_labels_indices.csv --n_class 200 --n-epochs 40 --batch-size 24 --lr 5e-4 --model efficientnet --eff_b 2 --impretrain True --att_head 4 --freqm 48 --timem 192 --mixup 0.5 --bal True --lr_patience 2 --dataset_mean -4.6476 --dataset_std 4.5699 --target_length 3000 --noise False --metrics mAP --warmup True --loss BCE --lrscheduler_start 10 --lrscheduler_decay 0.5 --wa True --wa_start 21 --wa_end 40
Traceback (most recent call last):
  File "../../src/run.py", line 9, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

from psla.

YuanGongND avatar YuanGongND commented on May 27, 2024

This is a different problem, you would need to install the dependencies, see https://github.com/YuanGongND/psla#getting-started.

The previous issues is not torch related, have you checked sox?

from psla.

aandreysr avatar aandreysr commented on May 27, 2024

The previously mentioned issue, now it creates the folders, and only a few audios are being converted in the folder FSD50K.dev_audio_16k. When I run the network, it displays the error below, and the folder FSD50K.eval_audio_16k remains empty.

 File "/home/andrey/mestrado/venv-psla/lib/python3.7/site-packages/torchaudio/backend/sox_backend.py", line 35, in load
    raise OSError("{} not found or is a directory".format(filepath))
OSError: ./dataset/FSD50K.dev_audio_16k/35034.wav not found or is a directory

from psla.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.