Assertion `srcIndex < srcSelectDimSize` failed

2023-11-08 16:28

本文主要是介绍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的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/371068

相关文章

android java.io.IOException: open failed: ENOENT (No such file or directory)-api23+权限受权

问题描述 在安卓上,清单明明已经受权了读写文件权限,但偏偏就是创建不了目录和文件 调用mkdirs()总是返回false. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_E

UserWarning: mkl-service package failed to import

安装完成anaconda,并设置了两个环境变量  之后再控制台运行python环境,输入import numpy as np,提示错误 D:\InstallFolder\Anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore

Python安装llama库出错“metadata-generation-failed”

Python安装llama库出错“metadata-generation-failed” 1. 安装llama库时出错2. 定位问题1. 去官网下载llama包 2.修改配置文件2.1 解压文件2.2 修改配置文件 3. 本地安装文件 1. 安装llama库时出错 2. 定位问题 根据查到的资料,发现时llama包中的execfile函数已经被下线了,需要我们手动修改代码后

Typora配置PicGo时,提示Failed to fetch

Typora配置PicGo时,提示Failed to fetch 两者配置的端口不一致造成的 打开Typora,选择文件-偏好设置-图像-验证图片上传选项,点击验证图片上传选项 会提示错误:Failed to fetch,此时可以发现typora中设置的上传端口为36677 打开PigGo,选择PicGo设置-设置server,会发现监听端口为36678 修改监听接口为366

Tomcat启动报错:transport error 202: bind failed: Address already in use

Tomcat启动报错:transport error 202: bind failed: Address already in use 了,上网查找了下面这篇文章。也是一种解决办法。 下文来自:http://blog.csdn.net/sam031503/article/details/7037033 tomcat 启动日志报出以下错误:  ERROR: transport err

SpringBoot启动报错Failed to determine a suitable driver class

两种解决办法 1.在Application类上加 ` @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) package com.example.demo3;import org.springframework.boot.SpringApplication;import org.springframewo

Failed to pull selection解决办法

今天在使用DDMS导出文档到PC端的时候,明明在file explorer里面有文件,导出时候就是失败,出现了“Failed to pull selection”错误。百度了一下,还是重启Eclipse最靠谱。

JavaBug系列- Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class load

JavaBug系列之Mysql驱动问题 Java医生一、关于错误信息二、如何解决问题 Java医生 本系列记录常见Bug,以及诊断过程和原因 Java/一对一零基础辅导/企业项目一对一辅导/日常Bug解决/代码讲解/毕业设计等 V:study_51ctofx 一、关于错误信息 APPLICATION FAILED TO START Description: Fai

王立平--Failed to push selection: Read-only file system

往android模拟器导入资源,失败。提示:只读文件、 mnt是只读文件。应点击sdcard,,在导入

兔子--Android Studio出现错误:Error:Execution failed for task ':myapp:dexDebug'. com.android.ide.common.pro

重点在:finished with non-zero exit value 2. 这里表明了有重复的内容存在。 由于:Android Studio中引入包的方式有如下2种:    compile 'com.android.support:support-v4:22.0.0'    compile files('libs/support-v