SyntaxError: invalid syntax when training a neural network model

SyntaxError: invalid syntax when training a neural network model

我正在尝试训练模型(https://github.com/bmild/nerf), and I am getting the error below when I run this 代码。

部分代码为:

def recenter_poses(poses):
poses_ = poses+0
bottom = np.reshape([0,0,0,1.], [1,4])
c2w = poses_avg(poses)
c2w = np.concatenate([c2w[:3,:4], bottom], -2)
bottom = np.tile(np.reshape(bottom, [1,1,4]), [poses.shape[0],1,1])
poses = np.concatenate([poses[:,:3,:4], bottom], -2)

poses = np.linalg.inv(c2w) @ poses
poses_[:,:3,:4] = poses[:,:3,:4]
poses = poses_
return poses

错误:

Traceback (most recent call last):   
File "run_nerf.py", line 12, in <module>
     from load_llff import load_llff_data   
File "/home/DNN/Softwares/nerf-master/load_llff.py", line 176
     poses = np.linalg.inv(c2w) @ poses
                                ^ SyntaxError: invalid syntax``

非常感谢任何帮助!我是新来的。谢谢:)

@ 在 Python 3.5 之前不支持。如果你有一个旧版本,也许你可以 运行 这样使用 numpy.dot:

poses = np.dot(np.linalg.inv(c2w), poses)

PEP465