An error while using tune for hyper-parameters a deep learning model

孤人 提交于 2020-06-29 04:43:03

问题


I'm trying to use tune to tune my model in Pytorch (https://docs.ray.io/en/latest/tune.html), as a starting point; I just tried to run their small example:

import torch.optim as optim
from ray import tune
from ray.tune.examples.mnist_pytorch import get_data_loaders, ConvNet, train, test


def train_mnist(config):
    train_loader, test_loader = get_data_loaders()
    model = ConvNet()
    optimizer = optim.SGD(model.parameters(), lr=config["lr"])
    for i in range(10):
        train(model, optimizer, train_loader)
        acc = test(model, test_loader)
        tune.track.log(mean_accuracy=acc)


analysis = tune.run(
    train_mnist, config={"lr": tune.grid_search([0.001, 0.01, 0.1])})

print("Best config: ", analysis.get_best_config(metric="mean_accuracy"))

# Get a dataframe for analyzing trial results.
df = analysis.dataframe()

And I got this error:

I run it on a remote machine requesting 100 GB of memory. Any help with that please?

来源:https://stackoverflow.com/questions/62371787/an-error-while-using-tune-for-hyper-parameters-a-deep-learning-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!