mitmul / deeppose

DeepPose implementation in Chainer
http://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/42237.pdf
GNU General Public License v2.0
408 stars 129 forks source link

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

Open handale88 opened 7 years ago

handale88 commented 7 years ago

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'

StandWisdom commented 7 years ago

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 commented 7 years ago

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

StandWisdom commented 7 years ago

@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!

glitterzhang commented 5 years ago

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