Open svjan5 opened 7 years ago
I still see same self.batch_size = np.ceil(len(xys) / self.nbatches)
I still found this mistake: "sub_arys.append(_nx.swapaxes(sary[st:end], axis, 0))" "slice indices must be integers or None or have an index method"
This also happened with me for the following snippet in base.py.
def _optim(self, xys):
idx = np.arange(len(xys), dtype=int)
self.batch_size = np.ceil(len(xys) / self.nbatches)
batch_idx = np.arange(self.batch_size, len(xys), self.batch_size, dtype=int)
I just introduced the dtype=int
parameter to fix it.
Here: https://github.com/mnick/scikit-kge/blob/master/skge/base.py#L130
self.batch_size = np.ceil(len(xys) / self.nbatches)
self.batch_size = int(np.ceil(len(xys) / self.nbatches))
In the latest stable version of numpy (1.13.0)
np.ceil()
returns a float value not int.Because of this error, my code was crashing with:
Please make the change.