Hi @patrickvonplaten,
I’am following that notebook of you (i think the same of the post) : https://huggingface.co/blog/fine-tune-xlsr-wav2vec2 11
My machine is local + physical and equipped with Intel(R) Core™ i9-9900K CPU @ 3.60GHz + 32GB of RAM + GeForce RTX 2060 which i think is uncapable to load the pretrained model wav2vec2-large-xlsr-53 because the vram is insufficient. I have followed that thread because the error obtained look similar:
trainer.train RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 5.79 GiB total capacity; 4.68 GiB already allocated; 1.44 MiB free; 4.76 GiB reserved in total by PyTorch)
I’am using the standard turquish common_voice resource is in essence a copy paste of your code in the notebook without the text explanations, whole work the same as long as the train fail because vram is insufficient.
I have tried decreasing per_device_train_batch_size value on the TrainingArguments and adding that following suggested code in other threads i read before without success
import gc
gc.collect()
torch.cuda.empty_cache()
trainer.train()
Also eliminating audios of duration greater than 6 seconds with this code:
from mutagen.mp3 import MP3
def mutagen_length(path):

try:*

   audio = MP3(path)*



   length = audio.info.length*



   return length*


except:*

   return None*



def _saca_chantas(datos):

if (mutagen_length(datos[“path”]) > 6):*

   return False*


else:*

   return True*



common_voice_train = common_voice_train.filter(_saca_chantas)
Changing the pretrain model with this smaller one: wav2vec2-base, it success!.
I want know which are the minimal requirements of the video card in order to load the pretrain model wav2vec2-large-xlsr-53 to acquire the appropriate one, if you can recommend a models of suitable nvidia card i could buy and/or a way to make the one i have Nvidia GeForce RTX 2060 do the work without abort with vram exausted?
Thank’s for your time reading that, your notebook are a great helpful resource, if you can make a recommendation i should be very grateful.