pytorch / audio

Data manipulation and transformation for audio signal processing, powered by PyTorch
https://pytorch.org/audio
BSD 2-Clause "Simplified" License
2.52k stars 651 forks source link

Hubert Pre-Training Example : Unable to load the saved checkpoint and resume training #3444

Open varun-krishnaps opened 1 year ago

varun-krishnaps commented 1 year ago

🐛 Describe the bug

Issue with Hubert Pre-training scripts in : https://github.com/pytorch/audio/tree/main/examples/hubert

I am unable to resume the training by loading the latest "End of the epoch" checkpoints.

I get the following error :

lightning.fabric.utilities.exceptions.MisconfigurationException: ModelCheckpoint(monitor='train_loss') could not find the monitored key in the returned metrics: ['val_loss', 'val_loss_epoch', 'val_masked_accuracy', 'val_masked_accuracy_epoch', 'val_unmasked_accuracy', 'val_unmasked_accuracy_epoch', 'epoch', 'step']. HINT: Did you call log('train_loss', value) in the LightningModule?

while loading the latest saved checkpoint.

Can someone please help me fix this ???

Versions

Collecting environment information... PyTorch version: 2.0.1+cu117 Is debug build: False CUDA used to build PyTorch: 11.7 ROCM used to build PyTorch: N/A

OS: Rocky Linux 8.6 (Green Obsidian) (x86_64) GCC version: (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10) Clang version: Could not collect CMake version: version 3.26.4 Libc version: glibc-2.28

Python version: 3.9.13 (main, Aug 25 2022, 23:26:10) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-4.18.0-372.9.1.el8.x86_64-x86_64-with-glibc2.28 Is CUDA available: False CUDA runtime version: 11.6.124 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: Could not collect Nvidia driver version: Could not collect cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 48 On-line CPU(s) list: 0-47 Thread(s) per core: 2 Core(s) per socket: 24 Socket(s): 1 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 23 Model: 49 Model name: AMD EPYC 7402P 24-Core Processor Stepping: 0 CPU MHz: 2800.000 CPU max MHz: 2800.0000 CPU min MHz: 1500.0000 BogoMIPS: 5599.83 Virtualization: AMD-V L1d cache: 32K L1i cache: 32K L2 cache: 512K L3 cache: 16384K NUMA node0 CPU(s): 0-47 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es

Versions of relevant libraries: [pip3] flake8==4.0.1 [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.24.2 [pip3] numpydoc==1.4.0 [pip3] pytorch-lightning==2.0.3 [pip3] pytorch-metric-learning==2.1.2 [pip3] pytorch-optimizer==2.10.0 [pip3] torch==2.0.1 [pip3] torchaudio==2.0.2 [pip3] torchmetrics==0.11.4 [pip3] torchvision==0.15.2 [pip3] triton==2.0.0 [conda] blas 1.0 mkl
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py39h7f8727e_0
[conda] mkl_fft 1.3.1 py39hd3c417c_0
[conda] mkl_random 1.2.2 py39h51133e4_0
[conda] numpy 1.24.2 pypi_0 pypi [conda] numpydoc 1.4.0 py39h06a4308_0
[conda] pytorch-cuda 11.6 h867d48c_1 pytorch [conda] pytorch-lightning 2.0.3 pypi_0 pypi [conda] pytorch-metric-learning 2.1.2 pypi_0 pypi [conda] pytorch-mutex 1.0 cuda pytorch [conda] pytorch-optimizer 2.10.0 pypi_0 pypi [conda] torch 2.0.1 pypi_0 pypi [conda] torchaudio 2.0.2 pypi_0 pypi [conda] torchmetrics 0.11.4 pypi_0 pypi [conda] torchvision 0.15.2 pypi_0 pypi [conda] triton 2.0.0 pypi_0 pypi

nateanl commented 1 year ago

Hi @varun-krishnaps, I can reproduce the issue. I think it is related with checkpoint API in lightning 2.0 because the previous version passed without error. Let me look into it.

varun-krishnaps commented 1 year ago

In which version of pytorch lightning did it pass without any error??

varun-krishnaps commented 1 year ago

Hi @varun-krishnaps, I can reproduce the issue. I think it is related with checkpoint API in lightning 2.0 because the previous version passed without error. Let me look into it.

In which version did the code run without any error ???

nateanl commented 1 year ago

pytorch lightning 1.x should be good.

varun-krishnaps commented 1 year ago

Any updates on this issue ??