Skip to content

Commit 5389e23

Browse files
authored
Update model.py
prevent xrange error: float cannot be interpreted as an integer
1 parent 3041fa3 commit 5389e23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def train(self, config):
198198
np.random.shuffle(self.data)
199199
batch_idxs = min(len(self.data), config.train_size) // config.batch_size
200200

201-
for idx in xrange(0, batch_idxs):
201+
for idx in xrange(0, int(batch_idxs)):
202202
if config.dataset == 'mnist':
203203
batch_images = self.data_X[idx*config.batch_size:(idx+1)*config.batch_size]
204204
batch_labels = self.data_y[idx*config.batch_size:(idx+1)*config.batch_size]

0 commit comments

Comments
 (0)