Expected all tensors to be on the same device
I am using hugging face library in order to fine tune recogniton for a local dialect. Before it was working very well, but since yesterday I am becoming error:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument weight in method wrapper___slow_conv2d_forward)The model is downloaded from hugging face hub and I made sure, that all input data is on cuda:image1800×858 104 KBFrom the screenshots above you may see, that all possible values are on cuda.As a standard I also moved whole model to the cuda too:from transformers import Wav2Vec2ForCTC

model_name = "jonatasgrosman/wav2vec2-large-xlsr-53-german"

model = Wav2Vec2ForCTC.from_pretrained(model_name).cuda()In case of my runtime error I’d like to know what exactly is still on cpu and how possibly could I solve that problem
2022-04-27T08:45:31Z
Check {}.is.cuda return True or False.
2022-04-27T10:19:04Z
Is the model itself on GPU?If you use the Trainer, you do not have to do any of these.cudaor.toclasses manually: it does that for you.
2022-04-30T04:18:06Z
Hi BogdanThis is being addressed in this Github issue:When running the Trainer cell, it found two devices (cuda:0 and CPU) · Issue #31 · nlp-with-transformers/notebooks · GitHubThere is a propsed workaround in the thread, hope that helps.CheersHeiko