lfz / DSB2017

The solution of team 'grt123' in DSB2017
MIT License
1.23k stars 420 forks source link

IndexError: too many indices for array #53

Open nkh222 opened 6 years ago

nkh222 commented 6 years ago

what does this means?

File ".../DSB2017-master/training/classifier/trainval_classifier.py", line 73, in train_casenet tpn += np.sum(1==pred[ydata==1]) IndexError: too many indices for array

bfan1256 commented 6 years ago

Just change the code to be pred[(ydata == 1).flatten)]. Do this for all of the ydata ones, or you can change it to ydata.flatten() before any of the boolean maskings.

bfan1256 commented 6 years ago

Please close this if the problem is solved. @lfz @nkh222

wayneguo279 commented 5 years ago

ydata=ydata.reshape(-1)