LAION-AI / CLAP

Contrastive Language-Audio Pretraining
https://arxiv.org/abs/2211.06687
Creative Commons Zero v1.0 Universal
1.4k stars 135 forks source link

only test #110

Open wwfcnu opened 1 year ago

wwfcnu commented 1 year ago

When I don't train, just test based on a pretrained checkpoint, I use the following script:

srun --comment clap --cpu_bind=v --accel-bind=gn python -m laion_clap.training.main \
    --save-frequency 5 \
    --save-top-performance 3 \
    --save-most-recent \
    --dataset-type="webdataset" \
    --precision="fp32" \
    --batch-size=256 \
    --lr=1e-5 \
    --wd=0.0 \
    --epochs=0 \
    --workers=6 \
    --use-bn-sync \
    --amodel HTSAT-base \
    --tmodel chineseclip \
    --warmup 3200 \
    --freeze-audio \
    --datasetnames "clotho" "audiocaps" "sounddesc" \
    --datasetinfos "train" "unbalanced_train" \
    --logs "clap_test_logs" \
    --seed 3407 \
    --datasetpath "/home/wangweifei/repository/wair/webdataset_tar/chinese" \
    --gather-with-grad \
    --optimizer "adam" \
    --data-filling "repeatpad" \
    --data-truncating "rand_trunc" \
    --pretrained '/home/tangshuai/repository/audio_generation/CLAP/experiment_scripts/clap_logs/2023_07_12-19_51_52-model_HTSAT-base-lr_1e-05-b_256-j_6-p_fp32/checkpoints/epoch_90.pt'

Run this script, the error message displayed in the log is

Traceback (most recent call last):
  File "/home/tangshuai/anaconda3/envs/audioldm/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/tangshuai/anaconda3/envs/audioldm/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/tangshuai/repository/audio_generation/CLAP/src/laion_clap/training/main.py", line 609, in <module>
    main()
  File "/home/tangshuai/repository/audio_generation/CLAP/src/laion_clap/training/main.py", line 333, in main
    total_steps = data["train"].dataloader.num_batches * args.epochs
KeyError: 'train'
RetroCirce commented 1 year ago

You can use our pip library to infer or test the data. Or you can refer to this code and this script to build your own testing.