-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Labels
bugSomething isn't workingSomething isn't workingfixreadyFix has landed on master.Fix has landed on master.
Description
I 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 #94 doesn't change anything.
pip freezes for both environments:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixreadyFix has landed on master.Fix has landed on master.