window_loc = np.reshape(window[i], [1, 1])
self.csv_out[i] = self._initialise_empty_csv(1)
else:
window[i] = np.asarray(window[i])
try:
assert window[i].ndim <= 2
except (TypeError, AssertionError):
tf.logging.error(
"The output you are trying to "
"save as csv is more than "
"bidimensional. Did you want "
"to save an image instead? "
"Put the keyword window "
"in the output dictionary"
" in your application file")
if window[i].ndim < 2:
window[i] = np.expand_dims(window[i], 0)
window_loc = window[i]
self.csv_out[i] = self._initialise_empty_csv(
n_channel=window[i][0].shape[-1])
self.csv_out[i] = np.concatenate([self.csv_out[i],
window_loc], 0)
After Change
window_loc = np.reshape(window[i], [1, 1])
self.csv_out[i] = self._initialise_empty_csv(1)
else:
window_save = np.asarray(np.squeeze(window[i][
batch_id,
...]))
try:
assert window_save.ndim <= 2
except (TypeError, AssertionError):
tf.logging.error(
"The output you are trying to "
"save as csv is more than "
"bidimensional. Did you want "
"to save an image instead? "
"Put the keyword window "
"in the output dictionary"
" in your application file")
while window_save.ndim < 2:
window_save = np.expand_dims(window_save, 0)
window_loc = window[i]
self.csv_out[i] = self._initialise_empty_csv(
n_channel=window_save.shape[-1])
self.csv_out[i] = np.concatenate([self.csv_out[i],
window_loc], 0)