deeppose icon indicating copy to clipboard operation
deeppose copied to clipboard

TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe'

Open handale88 opened this issue 8 years ago • 4 comments

Hello! I am testing with your code, however I got dtype typeerror when training with shell scripts.. Is there any solution that I can fix this?


File "/home/seungheelee/download/caffe/scripts/dataset.py", line 169, in get_example image, joints = self.apply_rotate(image, joints, ignore_joints) File "/home/seungheelee/download/caffe/scripts/dataset.py", line 133, in apply_rotate joints = ((rot_mat.dot((joints - joint_center).T)).T) + joint_center TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe'

handale88 avatar Dec 15 '16 05:12 handale88

Hi,I also face this problem. when I want to run "/tests/test_dataset.py" to test the trained model. here is the error, How can i fix it? relly eager

ERROR: test_apply_rotate (main.TestPoseDataset)

Traceback (most recent call last): File "tests/test_dataset.py", line 152, in test_apply_rotate image, joints = self.dataset.apply_rotate(image, joints, ig) File "scripts/dataset.py", line 134, in apply_rotate a = rot_mat.dot((joints - joint_center).T).T TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe'

====================================================================== ERROR: test_flic (main.TestPoseDataset)

Traceback (most recent call last): File "tests/test_dataset.py", line 190, in test_flic image, joints, ignore_joints = dataset.get_example(i) File "scripts/dataset.py", line 175, in get_example image, joints = self.apply_rotate(image, joints, ignore_joints) File "scripts/dataset.py", line 134, in apply_rotate a = rot_mat.dot((joints - joint_center).T).T TypeError: Cannot cast array data from dtype('float64') to dtype('<U32') according to the rule 'safe'

StandWisdom avatar Mar 07 '17 02:03 StandWisdom

Is Python's version problem? My python version is 2.7.x

StandWisdom avatar Mar 07 '17 03:03 StandWisdom

@handale88 I have solved this problem. This problem result from '/script/detaset.py' line:133 "rot_mat = np.matrix('{} {}; {} {}'.format(c, -s, s, c))" , U can use "print(rot_mat)" to find the reason .rot_mat is one matrix.(>>'u'.{0 0.0,-0.0 1.0})

I rewrite this code to " rot_mat = np.array([[1.0,0.0],[-0.0,1.0]]) " ,and then the program works correctly!

StandWisdom avatar Mar 07 '17 06:03 StandWisdom

solved by referring https://github.com/blue-yonder/tsfresh/issues/485#issuecomment-500712565

glitterzhang avatar Jun 11 '19 06:06 glitterzhang