本文主要是介绍Assertion `srcIndex < srcSelectDimSize` failed,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错如下:
将设备改为CPU,就定位到错误了:
Traceback (most recent call last):File "./training.py", line 713, in <module>train_body_pixel()File "./training.py", line 685, in train_body_pixeltrainer.fit(pixel_model, train_loader, val_loader)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 532, in fitcall._call_and_handle_interrupt(File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 43, in _call_and_handle_interruptreturn trainer_fn(*args, **kwargs)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 571, in _fit_implself._run(model, ckpt_path=ckpt_path)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 980, in _runresults = self._run_stage()File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1021, in _run_stageself._run_sanity_check()File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1050, in _run_sanity_checkval_loop.run()File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/loops/utilities.py", line 181, in _decoratorreturn loop_run(self, *args, **kwargs)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 115, in runself._evaluation_step(batch, batch_idx, dataloader_idx)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 376, in _evaluation_stepoutput = call._call_strategy_hook(trainer, hook_name, *step_kwargs.values())File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py", line 293, in _call_strategy_hookoutput = fn(*args, **kwargs)File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/strategies/strategy.py", line 393, in validation_stepreturn self.model.validation_step(*args, **kwargs)File "./training.py", line 412, in validation_steploss = self._calc_loss(latents, batch["mfcc"].transpose(1, 2), batch["speaker"])File "./training.py", line 370, in _calc_losslogits = self.generator(latents[:, :], id, audio)File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_implreturn forward_call(*args, **kwargs)File "/root/autodl-tmp/wav2motion/wav2motion/models/spg/gated_pixelcnn_v2.py", line 181, in forwardx = self.embedding(x.view(-1)).view(shp) # (B, H, W, C) # TODO: (√) 是不是应该两个emb?最后给展平了,手和身体的合起来了File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_implreturn forward_call(*args, **kwargs)File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 162, in forwardreturn F.embedding(File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py", line 2210, in embeddingreturn torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self
这篇关于Assertion `srcIndex < srcSelectDimSize` failed的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!