InstantMesh icon indicating copy to clipboard operation
InstantMesh copied to clipboard

IndexError: too many indices for tensor of dimension 2

Open throb081 opened this issue 1 year ago • 1 comments

你好,我在运行训练代码,model.py文件里面这一段: input_c2ws=torch.tensor(batch['input_c2ws']) print(input_c2ws.shape) #nput_c2ws=np.array(batch['input_c2ws'].cpu()) input_c2ws=input_c2ws.reshape(input_c2ws.shape[0],-1) #input_c2ws=input_c2ws.flatten(-2) input_Ks = batch['input_Ks'].flatten(-2)

    input_extrinsics = input_c2ws[:, :, :12],

报了IndexError: too many indices for tensor of dimension 2的错误,我的input_c2ws是644的list,所以源代码的flatten操作我改成了reshape,变换后应该是6*16,但是input_c2ws[:, :, :12]这一行就执行不了,所以想问问看您之前跑的时候的input_c2ws的维度具体是多少呢?是我这边的维度有错么

throb081 avatar Jun 13 '24 01:06 throb081

Probably something wrong with your input_cam var here. But honestly the naming convention in the dataset script about c2ws and w2cs means literally the opposite, so making it somewhat confusing...

HaFred avatar Aug 11 '24 10:08 HaFred