tensorboard steps limit to 40?
I'm using keras 2.24 + tensorflow (1.12.0) to evaluate my learning experiments. I have a custom Tensorboard class inherited from keras.callbacks.TensorBoard
to add in summary images to tensorboard. However, it seems that I can only visualize up to 40 epochs when I have already trained to 90~ epochs? Is this a limitation of tensorboard itself (do I have to change some settings to see data of latter epochs?) or is there something wrong with my Tensorboard code?
class MaskImageTensorBoard(TensorBoard):
def __init__(self, target_size, image_every_x_epochs, output_name, log_dir, data_vis_dir, **kwargs):
self.save_freq = image_every_x_epochs
self.output_name = output_name
self.data_vis_dir = data_vis_dir
self.target_size = target_size
super(MaskImageTensorBoard, self).__init__(log_dir, **kwargs)
def _load_images(self, image_list):
image_arr =
for f in image_list:
img = Image.open(f).resize((self.target_size[1], self.target_size[0]), Image.ANTIALIAS)
image_arr.append(np.array(img))
return np.array(image_arr)
def on_epoch_end(self, epoch, logs=None):
limit = 5
threshold = 0.5
color = [0, 255, 0]
if epoch % self.save_freq == 0:
image_list = [os.path.join(self.data_vis_dir, f) for f in random.sample(os.listdir(self.data_vis_dir), limit )]
images = self._load_images(image_list)
images2 = images / 255.
predictions = K.get_session().run(self.model.output, feed_dict = {self.model.input : images2})
predictions[predictions >= threshold] = 1
predictions[predictions < threshold] = 0 #shape [5, h, w, 1]
mask = np.apply_along_axis(lambda channel: np.concatenate([channel, channel, channel], axis=-1), 3, predictions)
mask *= color
masked_img = 0.5 * images + 0.5 * mask
masked_tensor = tf.convert_to_tensor(masked_img)
summ = tf.summary.image("Validation epoch {}".format(epoch), masked_tensor)
s = self.sess.run(summ)
self.writer.add_summary(s)
super(MaskImageTensorBoard, self).on_epoch_end(epoch, logs)
tensorflow keras tensorboard
add a comment |
I'm using keras 2.24 + tensorflow (1.12.0) to evaluate my learning experiments. I have a custom Tensorboard class inherited from keras.callbacks.TensorBoard
to add in summary images to tensorboard. However, it seems that I can only visualize up to 40 epochs when I have already trained to 90~ epochs? Is this a limitation of tensorboard itself (do I have to change some settings to see data of latter epochs?) or is there something wrong with my Tensorboard code?
class MaskImageTensorBoard(TensorBoard):
def __init__(self, target_size, image_every_x_epochs, output_name, log_dir, data_vis_dir, **kwargs):
self.save_freq = image_every_x_epochs
self.output_name = output_name
self.data_vis_dir = data_vis_dir
self.target_size = target_size
super(MaskImageTensorBoard, self).__init__(log_dir, **kwargs)
def _load_images(self, image_list):
image_arr =
for f in image_list:
img = Image.open(f).resize((self.target_size[1], self.target_size[0]), Image.ANTIALIAS)
image_arr.append(np.array(img))
return np.array(image_arr)
def on_epoch_end(self, epoch, logs=None):
limit = 5
threshold = 0.5
color = [0, 255, 0]
if epoch % self.save_freq == 0:
image_list = [os.path.join(self.data_vis_dir, f) for f in random.sample(os.listdir(self.data_vis_dir), limit )]
images = self._load_images(image_list)
images2 = images / 255.
predictions = K.get_session().run(self.model.output, feed_dict = {self.model.input : images2})
predictions[predictions >= threshold] = 1
predictions[predictions < threshold] = 0 #shape [5, h, w, 1]
mask = np.apply_along_axis(lambda channel: np.concatenate([channel, channel, channel], axis=-1), 3, predictions)
mask *= color
masked_img = 0.5 * images + 0.5 * mask
masked_tensor = tf.convert_to_tensor(masked_img)
summ = tf.summary.image("Validation epoch {}".format(epoch), masked_tensor)
s = self.sess.run(summ)
self.writer.add_summary(s)
super(MaskImageTensorBoard, self).on_epoch_end(epoch, logs)
tensorflow keras tensorboard
add a comment |
I'm using keras 2.24 + tensorflow (1.12.0) to evaluate my learning experiments. I have a custom Tensorboard class inherited from keras.callbacks.TensorBoard
to add in summary images to tensorboard. However, it seems that I can only visualize up to 40 epochs when I have already trained to 90~ epochs? Is this a limitation of tensorboard itself (do I have to change some settings to see data of latter epochs?) or is there something wrong with my Tensorboard code?
class MaskImageTensorBoard(TensorBoard):
def __init__(self, target_size, image_every_x_epochs, output_name, log_dir, data_vis_dir, **kwargs):
self.save_freq = image_every_x_epochs
self.output_name = output_name
self.data_vis_dir = data_vis_dir
self.target_size = target_size
super(MaskImageTensorBoard, self).__init__(log_dir, **kwargs)
def _load_images(self, image_list):
image_arr =
for f in image_list:
img = Image.open(f).resize((self.target_size[1], self.target_size[0]), Image.ANTIALIAS)
image_arr.append(np.array(img))
return np.array(image_arr)
def on_epoch_end(self, epoch, logs=None):
limit = 5
threshold = 0.5
color = [0, 255, 0]
if epoch % self.save_freq == 0:
image_list = [os.path.join(self.data_vis_dir, f) for f in random.sample(os.listdir(self.data_vis_dir), limit )]
images = self._load_images(image_list)
images2 = images / 255.
predictions = K.get_session().run(self.model.output, feed_dict = {self.model.input : images2})
predictions[predictions >= threshold] = 1
predictions[predictions < threshold] = 0 #shape [5, h, w, 1]
mask = np.apply_along_axis(lambda channel: np.concatenate([channel, channel, channel], axis=-1), 3, predictions)
mask *= color
masked_img = 0.5 * images + 0.5 * mask
masked_tensor = tf.convert_to_tensor(masked_img)
summ = tf.summary.image("Validation epoch {}".format(epoch), masked_tensor)
s = self.sess.run(summ)
self.writer.add_summary(s)
super(MaskImageTensorBoard, self).on_epoch_end(epoch, logs)
tensorflow keras tensorboard
I'm using keras 2.24 + tensorflow (1.12.0) to evaluate my learning experiments. I have a custom Tensorboard class inherited from keras.callbacks.TensorBoard
to add in summary images to tensorboard. However, it seems that I can only visualize up to 40 epochs when I have already trained to 90~ epochs? Is this a limitation of tensorboard itself (do I have to change some settings to see data of latter epochs?) or is there something wrong with my Tensorboard code?
class MaskImageTensorBoard(TensorBoard):
def __init__(self, target_size, image_every_x_epochs, output_name, log_dir, data_vis_dir, **kwargs):
self.save_freq = image_every_x_epochs
self.output_name = output_name
self.data_vis_dir = data_vis_dir
self.target_size = target_size
super(MaskImageTensorBoard, self).__init__(log_dir, **kwargs)
def _load_images(self, image_list):
image_arr =
for f in image_list:
img = Image.open(f).resize((self.target_size[1], self.target_size[0]), Image.ANTIALIAS)
image_arr.append(np.array(img))
return np.array(image_arr)
def on_epoch_end(self, epoch, logs=None):
limit = 5
threshold = 0.5
color = [0, 255, 0]
if epoch % self.save_freq == 0:
image_list = [os.path.join(self.data_vis_dir, f) for f in random.sample(os.listdir(self.data_vis_dir), limit )]
images = self._load_images(image_list)
images2 = images / 255.
predictions = K.get_session().run(self.model.output, feed_dict = {self.model.input : images2})
predictions[predictions >= threshold] = 1
predictions[predictions < threshold] = 0 #shape [5, h, w, 1]
mask = np.apply_along_axis(lambda channel: np.concatenate([channel, channel, channel], axis=-1), 3, predictions)
mask *= color
masked_img = 0.5 * images + 0.5 * mask
masked_tensor = tf.convert_to_tensor(masked_img)
summ = tf.summary.image("Validation epoch {}".format(epoch), masked_tensor)
s = self.sess.run(summ)
self.writer.add_summary(s)
super(MaskImageTensorBoard, self).on_epoch_end(epoch, logs)
tensorflow keras tensorboard
tensorflow keras tensorboard
asked Dec 28 '18 at 7:33
avpavp
163
163
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53955136%2ftensorboard-steps-limit-to-40%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53955136%2ftensorboard-steps-limit-to-40%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown