facebookresearch / localrf

An algorithm for reconstructing the radiance field of a large-scale scene from a single casually captured video.
MIT License
976 stars 60 forks source link

ERROR : cannot assign 'torch.cuda.FloatTensor' object to parameter '0' (torch.nn.Parameter or None required) #9

Closed Dragonkingpan closed 1 year ago

Dragonkingpan commented 1 year ago

train.py this line: self.r_c2w.append(torch.eye(3, 2, device=self.device))

error:

Traceback (most recent call last): File "D:\aiPrjs\localrf\localrf-main\localTensoRF\train.py", line 609, in
reconstruction(args) File "D:\aiPrjs\localrf\localrf-main\localTensoRF\train.py", line 252, in reconstruction
local_tensorfs = LocalTensorfs( File "D:\aiPrjs\localrf\localrf-main\localTensoRF\local_tensorfs.py", line 92, in init self.append_frame() File "D:\aiPrjs\localrf\localrf-main\localTensoRF\local_tensorfs.py", line 148, in append_frame self.r_c2w.append(torch.eye(3, 2, device=self.device)) File "D:\aiPrjs\env-faceswap\nope-nerf\lib\site-packages\torch\nn\modules\container.py", line 458, in append self.register_parameter(str(len(self)), parameter) File "D:\aiPrjs\env-faceswap\nope-nerf\lib\site-packages\torch\nn\modules\module.py", line 321, in register_parameter raise TypeError("cannot assign '{}' object to parameter '{}' " TypeError: cannot assign 'torch.cuda.FloatTensor' object to parameter '0' (torch.nn.Parameter or None required)

ameuleman commented 1 year ago

It looks like you are using a different environment. Could you please list installed python packages and their versions?

curryandklay commented 7 months ago

I met the same error. Is the cause of this problem the version of the python package? I have the package and version as shown

PixPin_2024-04-10_19-44-11