Skip to content

Commit 4ac569c

Browse files
committed
fix: Left some images out of training
1 parent 60e2373 commit 4ac569c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

train.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
from keras.layers.advanced_activations import LeakyReLU
2626
from keras.models import Model
2727
from math import sqrt, ceil
28-
from tqdm import tqdm_notebook as tqdm
2928
import cv2
3029
from sklearn.utils import shuffle
3130
from tqdm import tqdm
3231
import tifffile as tif
33-
from model import msrf
3432
from model import *
3533
from tensorflow.keras.callbacks import *
3634
import skimage.io
@@ -90,7 +88,7 @@
9088

9189
def train(epochs, batch_size,output_dir, model_save_dir):
9290

93-
batch_count = int(len(train_x) / batch_size)
91+
batch_count = ceil(len(train_x) / batch_size)
9492
max_val_dice= -1
9593
G = msrf()
9694
G.summary()
@@ -99,7 +97,7 @@ def train(epochs, batch_size,output_dir, model_save_dir):
9997
for e in range(1, epochs+1):
10098
print ('-'*15, 'Epoch %d' % e, '-'*15,batch_size)
10199
#sp startpoint
102-
for sp in range(0,batch_count,1):
100+
for sp in tqdm(range(0,batch_count,1), desc="Batches"):
103101
if (sp+1)*batch_size>len(train_x):
104102
batch_end = len(train_x)
105103
else:

0 commit comments

Comments
 (0)