question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tune example on landing page is broken!

See original GitHub issue

Hi - I started a cluster, pulling the rayproject/ray:latest-gpu container.

It has python 3.7.7, and running the tune example on the landing page gives:

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()

Error:

Traceback:
Traceback (most recent call last):
  File "/root/anaconda3/lib/python3.7/site-packages/ray/function_manager.py", line 493, in _load_actor_class_from_gcs
    actor_class = pickle.loads(pickled_class)
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/__init__.py", line 2, in <module>
    from ray.tune.tune import run_experiments, run
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/tune.py", line 7, in <module>
    from ray.tune.analysis import ExperimentAnalysis
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/analysis/__init__.py", line 1, in <module>
    from ray.tune.analysis.experiment_analysis import ExperimentAnalysis, Analysis
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/analysis/experiment_analysis.py", line 19, in <module>
    from ray.tune.trial import Trial
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/trial.py", line 15, in <module>
    from ray.tune.durable_trainable import DurableTrainable
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/durable_trainable.py", line 4, in <module>
    from ray.tune.trainable import Trainable, TrainableUtil
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/trainable.py", line 23, in <module>
    from ray.tune.logger import UnifiedLogger
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/logger.py", line 15, in <module>
    from ray.tune.syncer import get_node_syncer
  File "/root/anaconda3/lib/python3.7/site-packages/ray/tune/syncer.py", line 80, in <module>
    @dataclass
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 958, in dataclass
    return wrap(_cls)
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 950, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 801, in _process_class
    for name, type in cls_annotations.items()]
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 801, in <listcomp>
    for name, type in cls_annotations.items()]
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 659, in _get_field
    if (_is_classvar(a_type, typing)
  File "/root/anaconda3/lib/python3.7/site-packages/dataclasses.py", line 550, in _is_classvar
    return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'

Ray looks really good, but it is frustrating when the landing page examples don’t work

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
aced125commented, Nov 18, 2020

@richardliaw @architkulkarni @ijrsvt Swapping installation works:

- pip install jupyterlab torch torchvision
- pip uninstall -y dataclasses

BUT - now I have a new error:

AttributeError: module 'ray.tune' has no attribute 'track'
1reaction
ijrsvtcommented, Nov 18, 2020

@aced125 Maybe try flipping the order of your installs. One potential problem here is that it seems like torch requires dataclasses

  - torch [required: >=1.6, installed: 1.7.0]
    - dataclasses [required: Any, installed: 0.6]
Read more comments on GitHub >

github_iconTop Results From Across the Web

17 Most Common Landing Page Mistakes [And How To Fix ...
Landing page mistake #1: Too many conversion goals​​ Yikes. This means a high-converting landing page should present its visitors with a single, well-defined ......
Read more >
Why Your Landing Page Isn't Converting: 11 Big Problems to ...
Is your landing page not converting? Here's a no-nonsense list of 11 landing page problems that kill conversions, plus how to fix them....
Read more >
Why Is My Landing Page Not Converting? 8 Reasons (+ How ...
Reason 1: Visitors don't trust you · Reason 2: You have too many distractions · Reason 3: You talk too much · Reason...
Read more >
3 Common Reasons Why Your Landing Page Isn't Working ...
The complete landing page consist of a headline, image, and must center around one product, in particular, to keep it clear and simple....
Read more >
The 30 Best Landing Page Examples To Steal & Profit From
Find out 30 different landing page examples you can “steal” from. Check at what they did right, and apply it to your own...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found