orobix / retina-unet

Retina blood vessel segmentation with a convolutional neural network
1.26k stars 468 forks source link

ZeroDivisionError #3

Closed pythonokai closed 7 years ago

pythonokai commented 7 years ago

Traceback (most recent call last): File "./src/retinaNN_predict.py", line 212, in precision = float(confusion[1,1])/float(confusion[1,1]+confusion[0,1]) ZeroDivisionError: float division by zero ===============This is my configration.txt=============== [data paths] path_local = ./DRIVE_datasets_training_testing/ train_imgs_original = DRIVE_dataset_imgs_train.hdf5 train_groundTruth = DRIVE_dataset_groundTruth_train.hdf5 train_border_masks = DRIVE_dataset_borderMasks_train.hdf5 test_imgs_original = DRIVE_dataset_imgs_test.hdf5 test_groundTruth = DRIVE_dataset_groundTruth_test.hdf5 test_border_masks = DRIVE_dataset_borderMasks_test.hdf5

[experiment name] name = my_test201609112025

[data attributes]

Dimensions of the patches extracted from the full images

patch_height = 48 patch_width = 48

[training settings]

number of total patches:

N_subimgs = 40

if patches are extracted only inside the field of view:

inside_FOV = False

Number of training epochs

N_epochs = 100 batch_size = 32

number of full images for the validation (max 20)

full_images_to_test = 20

if running with nohup

nohup = False

[testing settings]

Choose the model to test: best==epoch with min loss, last==last epoch

best_last = best

number of full images for the test (max 20)

full_images_to_test = 20

How many original-groundTrutuh-prediction images are visualized in each image

N_group_visual = 1

Compute average in the prediction, improve results but require more patches to be predicted

average_mode = False

Only if average_mode==True. Stride of the average, lower value require more patches to be predicted

stride_height = 45 stride_width = 45

if running with nohup

nohup = False

What should I do? Thanks for any help.

dcorti commented 7 years ago

If you performed a training with this configuration, I guess the network did not learn much, since 40 patches are definitely not enough data. I usually perform the training with at least 100000 patches (but a GPU is strongly recommended in this case) However, I fix the script so it will not crash in case of division by zero.

pythonokai commented 7 years ago

Thank you very much. And I am confuse that TWO settings are connected? ( some combination? ) I hope you don't mind mine poor ENG.

[data attributes]

Dimensions of the patches extracted from the full images

patch_height = 48 patch_width = 48

[training settings]

number of total patches:

N_subimgs = 175000 (100,000 at least)

Is that ORIGINAL dimensions divided patchsize == N_subimgs?

lantiga commented 7 years ago

Nope, N_subimgs is the number of 48x48 patches extracted at random from the training images.

pythonokai commented 7 years ago

ok, thanks