taomanwai / tensorboardcolab Goto Github PK
View Code? Open in Web Editor NEWA library make TensorBoard working in Colab Google
License: MIT License
A library make TensorBoard working in Colab Google
License: MIT License
tensorboardcolab/tensorboardcolab/core.py
Line 21 in 337dce9
Every time i rerun the setup, it removes all my saved summaries. While sometimes after a long run model, the ngrok connect breaks, so i have to rerun the tensorboardcolab, and hours of works are gone.
Of course i can always run ngrok http 6006
instead after the setup, but somehow i forget every time.
Please support eager execution
, which will be the default mode in TensorFlow v2
Hi all,
I am currently attempting to use Google Colab to graph some machine learning algorithms. Currently, whenever I create a model in the TensorBoard Scalar section I get two folders being the 'Training' and 'Validation' folders showing the data I need. However, when I run another model, the new data gets appended to those files as opposed to a new folder.
Is there a way to make unique named models that could be compared as opposed to appended to the same graph?
Directory path is hardcoded as 'training', right?
training_log_dir = os.path.join(log_dir, 'training')
Hi, when I add this callback to a simple Keras script in Colab I get the error:
FailedPreconditionError: Error while reading resource variable conv_dw_8_1/depthwise_kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/conv_dw_8_1/depthwise_kernel/N10tensorflow3VarE does not exist.
[[Node: conv_dw_8_1/depthwise/ReadVariableOp = ReadVariableOpdtype=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
[[Node: metrics_1/acc/Mean/_99 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_6754_metrics_1/acc/Mean", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]]
Any idea why?
/usr/local/lib/python3.6/dist-packages/tensorboardcolab/callbacks.py in set_model(self, model)
30 self.val_writer = tf.contrib.summary.create_file_writer(self.val_log_dir)
31 else:
---> 32 self.val_writer = tf.summary.FileWriter(self.val_log_dir)
33
34 super(TensorBoardColabCallback, self).set_model(model)
AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'FileWriter'
The callbacks parameter for Keras is not taking inputs for TensorBoardColabCallback. @taomanwai
https://colab.research.google.com/drive/19_QqEfi8WeNkbhRpxObukE8IggmMFJWY#scrollTo=UwtUJEjI51en
Please have a look or suggest a temporary solution.
Hello!
It seems that the latest 1.x version of Keras+Tensorflow requires an on_train_batch_begin
function definition that is missing...
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-14-f2f738e2066b> in <module>()
2 with session.as_default(), graph.as_default() :
3 model.set_weights(weights)
----> 4 result = model.fit(X_train, y_train, batch_size=32, epochs=100, verbose=0, shuffle=False, validation_data=(X_test, y_test), callbacks=[PrintDots(),TensorBoardColabCallback(tbc)])
5 end_time = time.perf_counter()
6 print( "time = " + str(end_time - start_time) + "s" )
2 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/callbacks.py in _call_batch_hook(self, mode, hook, batch, logs)
194 t_before_callbacks = time.time()
195 for callback in self.callbacks:
--> 196 batch_hook = getattr(callback, hook_name)
197 batch_hook(batch, logs)
198 self._delta_ts[hook_name].append(time.time() - t_before_callbacks)
AttributeError: 'TensorBoardColabCallback' object has no attribute 'on_train_batch_begin'
These are the versions of Tensorflow, Keras and tensorboardcolab that I'm using, respectively, which already come pre-installed in Google Colab:
1.13.1
2.2.4-tf
Requirement already up-to-date: tensorboardcolab in /usr/local/lib/python3.6/dist-packages (0.0.22)
Any workaround for this issue?
Thanks!
ImportError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/keras/callbacks.py in init(self, log_dir, histogram_freq, batch_size, write_graph, write_grads, write_images, embeddings_freq, embeddings_layer_names, embeddings_metadata, embeddings_data, update_freq)
744 import tensorflow as tf
--> 745 from tensorflow.contrib.tensorboard.plugins import projector
746 except ImportError:
4 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/init.py in ()
30 from tensorflow.contrib import cloud
---> 31 from tensorflow.contrib import cluster_resolver
32 from tensorflow.contrib import coder
/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/cluster_resolver/init.py in ()
25 from tensorflow.python.distribute.cluster_resolver.cluster_resolver import UnionClusterResolver
---> 26 from tensorflow.python.distribute.cluster_resolver.gce_cluster_resolver import GceClusterResolver
27 from tensorflow.python.distribute.cluster_resolver.kubernetes_cluster_resolver import KubernetesClusterResolver
ImportError: cannot import name 'GceClusterResolver'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in ()
17 epochs=5,
18 validation_data=(x_test, y_test),
---> 19 callbacks=[TensorBoardColabCallback(tbc)])
/usr/local/lib/python3.6/dist-packages/tensorboardcolab/callbacks.py in init(self, tbc, write_graph, **kwargs)
20
21 training_log_dir = os.path.join(log_dir, 'training')
---> 22 super(TensorBoardColabCallback, self).init(training_log_dir, **kwargs)
23
24 # Log the validation metrics to a separate subdirectory
/usr/local/lib/python3.6/dist-packages/keras/callbacks.py in init(self, log_dir, histogram_freq, batch_size, write_graph, write_grads, write_images, embeddings_freq, embeddings_layer_names, embeddings_metadata, embeddings_data, update_freq)
745 from tensorflow.contrib.tensorboard.plugins import projector
746 except ImportError:
--> 747 raise ImportError('You need the TensorFlow module installed to '
748 'use TensorBoard.')
749
ImportError: You need the TensorFlow module installed to use TensorBoard.
I use pytorch with the following implementation:
from tensorboardcolab import TensorBoardColab
tb = TensorBoardColab()
and this call:
tb.save_value('Validation Accuracy', 'valid_acc',i, validation_acc)
Traceback gives me this error:
AttributeError Traceback (most recent call last)
<ipython-input-23-1106bec90267> in <module>()
6 optimizer = optim.Adam(model.parameters(), lr=0.001, weight_decay=0.0001)
7 training_epochs = 150
----> 8 metrics = train(model, train_loader, test_loader, loss, optimizer, training_epochs)
9
10 summary(model, (3, 32,32))
1 frames
/usr/local/lib/python3.6/dist-packages/tensorboardcolab/core.py in save_value(self, graph_name, line_name, epoch, value)
99 tf.contrib.summary.scalar(graph_name, value)
100 else:
--> 101 summary = tf.Summary()
102 summary_value = summary.value.add()
103 summary_value.simple_value = value
AttributeError: module 'tensorflow' has no attribute 'Summary'
Something seems to be wrong with setup.
I attempted to run the tensorboardcolab tool in Colab as suggested in README,
!pip install -U tensorboardcolab
from tensorboardcolab import *
tbc=TensorBoardColab()
and got
(...)
Wait for 5 seconds...
Setup not passed, retry again (24)
(...)
Hi,
I have run my code and the checkpoints and event files already created in the collab content drive. How can I run this specific event file in tensorborad in Collab?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.