We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89ebbbb commit a66ccd7Copy full SHA for a66ccd7
_Dist/NeuralNetworks/i_CNN/CNN.py
@@ -51,7 +51,7 @@ def init_from_data(self, x, y, x_test, y_test, sample_weights, names):
51
else:
52
assert self.height == x.shape[1], "height is set to be {}, but {} found".format(self.height, x.shape[1])
53
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:
+ if x_test is not None and len(x_test.shape) == 2:
55
x_test = x_test.reshape(len(x_test), self.height, self.width, -1)
56
super(CNN, self).init_from_data(x, y, x_test, y_test, sample_weights, names)
57
0 commit comments