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] AttributeError: 'NoneType' object has no attribute 'get_global_worker'

See original GitHub issue

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04
  • Ray installed from (source or binary): binary
  • Ray version: 0.8.0.dev1
  • Python version: 3.7
  • Exact command to reproduce:
import ray
from ray import tune

ray.init()


def train_func(config, reporter):  # add a reporter arg
    accuracy = config["momentum"] * 2 + 0.3
    reporter(mean_accuracy=accuracy)  # report metrics


all_trials = tune.run(
    train_func,
    name="quick-start",
    stop={"mean_accuracy": 99},
    config={"momentum": tune.grid_search([0.1, 0.2])})

Describe the problem

When I run the script above (based on the examples from here), I get the following error at the end of each run:

Exception ignored in: <function ActorHandle.__del__ at 0x7f3aeaffc730>
Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.7/site-packages/ray/actor.py", line 613, in __del__
AttributeError: 'NoneType' object has no attribute 'get_global_worker'

However, this is not happening for 0.7.0.dev2, the process exists normally in that case.

This might be related to #4467 .

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ShamCondorcommented, Mar 18, 2020

Hm,I’m also removed tensorflow, so this issue go away now

1reaction
vakkercommented, Jul 10, 2019

@richardliaw Doing a bit of debugging it seems to be related to the Tensorboard logging. I used the Dockerfile:

FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04

RUN apt-get update && apt-get install -y --no-install-recommends wget

RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
  bash ./miniconda.sh -b -p /opt/conda
ENV PATH "/opt/conda/bin:$PATH"

RUN conda install -y -c conda-forge tensorflow==1.13.1 pandas
RUN pip install https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-0.8.0.dev2-cp37-cp37m-manylinux1_x86_64.whl

WORKDIR /
COPY test.py .

with test.py (same as above):

import ray
from ray import tune

ray.init()


def train_func(config, reporter):  # add a reporter arg
    accuracy = config["momentum"] * 2 + 0.3
    reporter(mean_accuracy=accuracy)  # report metrics


all_trials = tune.run(
    train_func,
    name="quick-start",
    stop={"mean_accuracy": 99},
    config={"momentum": tune.grid_search([0.1, 0.2])})

Running python /test.py does give the error at the end, but running export RLLIB_TEST_NO_TF_IMPORT=1; python /test.py (that just disables the TB logging according to here) does not give the error.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'NoneType' object has no attribute 'get' - Ray Tune
When I run my code I get the following error: any help please? Function checkpointing is disabled. This may result in unexpected behavior ......
Read more >
Why do I get AttributeError: 'NoneType' object has no attribute ...
NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None .
Read more >
AttributeError: 'NoneType' object has no attribute 'get_items'
Hello everyone, We have imported one job (Local Resolution Estimation) from an old project and an old instance onto a newly installed, ...
Read more >
AttributeError: 'NoneType' object has no attribute 'dtype'
Hello! I've been trying to fine-tune a german gpt-2 Modell with a dataset from huggingface via TensorFlow. When trying to start the Training ......
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