Skip to content

Commit a66ccd7

Browse files
committed
Update i_CNN
1 parent 89ebbbb commit a66ccd7

File tree

1 file changed

+1
-1
lines changed
  • _Dist/NeuralNetworks/i_CNN

1 file changed

+1
-1
lines changed

_Dist/NeuralNetworks/i_CNN/CNN.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def init_from_data(self, x, y, x_test, y_test, sample_weights, names):
5151
else:
5252
assert self.height == x.shape[1], "height is set to be {}, but {} found".format(self.height, x.shape[1])
5353
assert self.width == x.shape[2], "width is set to be {}, but {} found".format(self.height, x.shape[2])
54-
if len(x_test.shape) == 2:
54+
if x_test is not None and len(x_test.shape) == 2:
5555
x_test = x_test.reshape(len(x_test), self.height, self.width, -1)
5656
super(CNN, self).init_from_data(x, y, x_test, y_test, sample_weights, names)
5757

0 commit comments

Comments
 (0)