Visualization in tutorial not working in colab and remote setup
See original GitHub issueI have tried running this tutorial both in google colab and in jupyterlab on a remote server setup.
https://ax.dev/tutorials/tune_cnn.html
Both times the render()-call returns an empty output.
This is the code, no changes from tutorial except installation of ax:
!pip install ax-platform
%%
import torch
import numpy as np
from ax.plot.contour import plot_contour
from ax.plot.trace import optimization_trace_single_method
from ax.service.managed_loop import optimize
from ax.utils.notebook.plotting import render, init_notebook_plotting
from ax.utils.tutorials.cnn_utils import load_mnist, train, evaluate, CNN
init_notebook_plotting()
%%
torch.manual_seed(12345)
dtype = torch.float
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
%%
BATCH_SIZE = 512
train_loader, valid_loader, test_loader = load_mnist(batch_size=BATCH_SIZE)
%%
def train_evaluate(parameterization):
net = CNN()
net = train(net=net, train_loader=train_loader, parameters=parameterization, dtype=dtype, device=device)
return evaluate(
net=net,
data_loader=valid_loader,
dtype=dtype,
device=device,
)
%%
best_parameters, values, experiment, model = optimize(
parameters=[
{"name": "lr", "type": "range", "bounds": [1e-6, 0.4], "log_scale": True},
{"name": "momentum", "type": "range", "bounds": [0.0, 1.0]},
],
evaluation_function=train_evaluate,
objective_name='accuracy',
)
%%
render(plot_contour(model=model, param_x='lr', param_y='momentum', metric_name='accuracy'))
switching to classic jupyter notebook (in remote setup) as suggested in https://github.com/facebook/Ax/issues/94 doesn’t change anything.
pip freezes for both environments:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to Use Google Colab for Deep Learning
Since a Colab notebook can be accessed remotely from any machine through a browser, it's well suited for commercial purposes as well. In...
Read more >Google Colab Tutorial for Data Scientists - DataCamp
A brief guide for navigating google colab to carry out data science coding and collaborating with other data scientists.
Read more >Quick guide to run TensorBoard in Google Colab - DLology
We are going train a Keras model on Colab and visualize it while training with TensorBoard. But there is one thing we need...
Read more >Web visualizer and Jupyter — Open3D 0.16.0 documentation
You first start the visualization server on a local or remote machine, and then the 3D models can be viewed from any device...
Read more >PDF Google Colab - Tutorialspoint
in this tutorial, please notify us at contact@tutorialspoint.com ... Most importantly, it does not require a setup and the notebooks that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a simple workaround. Add
to the NB running on colab. The figure renders and is interactive 😃 (for smaller notebook file size at the expense of non-interactive plots, you can use “png” as the renderer)
Note: You also need to do
!pip install kaleido
.Still investigating colab half of this issue (realized this one was the right one to host discussion on).