Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我不能使用TF四元数的旋转四元数来旋转向量_Python_Tensorflow_Rotation_Quaternions - Fatal编程技术网

Python 我不能使用TF四元数的旋转四元数来旋转向量

Python 我不能使用TF四元数的旋转四元数来旋转向量,python,tensorflow,rotation,quaternions,Python,Tensorflow,Rotation,Quaternions,我想使用tfquaternion通过四元数旋转向量。但是我得到了以下错误 AttributeError:'numpy.ndarray'对象没有属性“normalized” 将TF四元数导入为tfq 训练点=tfq。通过四元数旋转向量(transf[:,3:,训练点) 它看起来像是tfq。按四元数旋转向量期望transf[:,3:][/code>是tfq.quaternion,但它只是一个np.ndarray,导致您的错误。您可以先尝试转换它: import tfquaternion as tfq

我想使用
tfquaternion
通过四元数旋转向量。但是我得到了以下错误

AttributeError:'numpy.ndarray'对象没有属性“normalized”

将TF四元数导入为tfq
训练点=tfq。通过四元数旋转向量(transf[:,3:,训练点)

它看起来像是
tfq。按四元数旋转向量
期望
transf[:,3:][/code>是
tfq.quaternion
,但它只是一个
np.ndarray
,导致您的错误。您可以先尝试转换它:

import tfquaternion as tfq
train_points = tfq.rotate_vector_by_quaternion(tfq.Quaternion(transf[:,3:]), train_points)
这样行吗