clovaai / voxceleb_trainer

In defence of metric learning for speaker recognition
MIT License
1.01k stars 272 forks source link

RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int #148

Closed muzihuole closed 2 years ago

muzihuole commented 2 years ago

Thanks for your code first. I try to train the VGGVox model with angular prototypical, but when I run python ./trainSpeakerNet.py --model VGGVox --log_input True --encoder_type SAP --trainfunc angleproto --save_path exps/vggvox --nPerSpeaker 2 --batch_size 200, there is an error like this: Traceback (most recent call last): File "./trainSpeakerNet.py", line 300, in <module> main() File "./trainSpeakerNet.py", line 296, in main main_worker(0, None, args) File "./trainSpeakerNet.py", line 226, in main_worker loss, traineer = trainer.train_network(train_loader, verbose=(args.gpu == 0)); File "C:\Users\Administrator\Desktop\Lis\voxceleb_trainer-master\SpeakerNet.py", line 109, in train_network nloss, prec1 = self.__model__(data, label) File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Administrator\Desktop\Lis\voxceleb_trainer-master\SpeakerNet.py", line 24, in forward return self.module(x, label) File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Administrator\Desktop\Lis\voxceleb_trainer-master\SpeakerNet.py", line 52, in forward nloss, prec1 = self.__L__.forward(outp, label) File "C:\Users\Administrator\Desktop\Lis\voxceleb_trainer-master\loss\angleproto.py", line 36, in forward nloss = self.criterion(cos_sim_matrix, label) File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\nn\modules\loss.py", line 1150, in forward return F.cross_entropy(input, target, weight=self.weight, File "C:\Users\Administrator\.conda\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 2846, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int'
Hope to receive your reply.

Jungjee commented 2 years ago

Hi, I tried the same script python ./trainSpeakerNet.py --model VGGVox --log_input True --encoder_type SAP --trainfunc angleproto --save_path exps/vggvox --nPerSpeaker 2 --batch_size 200. It seems to work fine for me.

Below are my configurations. Please refer to it and try again.


PyTorch: 1.10.0+cu113 Python 3.8.10