UNET-ZOO icon indicating copy to clipboard operation
UNET-ZOO copied to clipboard

u and v need to have the same number of columns

Open zhou-rui1 opened this issue 4 years ago • 3 comments

Hi, I try and try but always get this, could you give me some guidance?

File "main.py", line 268, in <module> train(model, criterion, optimizer, train_dataloaders,val_dataloaders, args) File "main.py", line 175, in train best_iou,aver_iou,aver_dice,aver_hd = val(model,best_iou,val_dataloader) File "main.py", line 112, in val hd_total += get_hd(mask[0], img_y) File "/content/UNET/metrics.py", line 148, in get_hd hd1 = directed_hausdorff(mask, predict)[0] File "/usr/local/lib/python3.7/dist-packages/scipy/spatial/distance.py", line 454, in directed_hausdorff raise ValueError('u and v need to have the same ' ValueError: u and v need to have the same number of columns

With appreciation

zhou-rui1 avatar Feb 27 '21 03:02 zhou-rui1

I had the same problem,Have you solved it?

Arwen831 avatar Apr 17 '21 11:04 Arwen831

I've had the same problem, but I've solved it and it might inspire you. I resize the size of the picture during training, so in get _ iou(), get _ had(), get _ dice(), mask picture need to be resized in the same size, hoping to help you.

Qiang-Feng98 avatar Jan 29 '22 13:01 Qiang-Feng98

I also need to resize the size of the picture during trainning ,could you tell me in which section to perform this operation ?

SmileMood avatar Mar 03 '24 13:03 SmileMood