AlonaGolts / Deep_Energy

Deep-Energy: Unsupervised Training of Deep Neural Networks
43 stars 10 forks source link

TypeError: `pad_width` must be of integral type. #1

Open arpita739 opened 4 years ago

arpita739 commented 4 years ago
Screenshot 2020-06-12 13 55 44

Please resolve this issue. Kindly Help me

arpita739 commented 4 years ago

Issue solved: Python 3 where / does floating point division by default; you might want to change that to // which performs integral division. change Utils.py line no. 427

Nyd-foreverYoung commented 1 year ago

Hello! I 'm having the same problem as you. After looking for a large number of solutions,I have solved this problem. The PYTHON version I'm using is 3.8. You can use this code : padded_image = np.pad(image, (((win_size[0]-1)//2,(win_size[0]-1)//2),((win_size[1]-1)//2,(win_size[1]-1)//2),(0,0)), 'edge') to replace the original code: padded_image = np.pad(image, (((win_size[0]-1)/2,(win_size[0]-1)/2),((win_size[1]-1)/2,(win_size[1]-1)/2),(0,0)), 'edge') The reason could be Python 3 where / does floating point division by default; you might want to change that to // which performs integral division.