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.

AttributeError: 'MultiProgressWidget' object has no attribute 'elapsed_time'

See original GitHub issue

I was getting an error that ipywidgets was not installed when I ran the following code

from cropmask.preprocess import PreprocessWorkflow, get_arr_channel_mean, setup_dirs
import time
import dask

param_path = "/home/ryan/work/CropMask_RCNN/cropmask/test_preprocess_config.yaml"
scene_list = [
    "/mnt/cropmaskperm/unpacked_landsat_downloads/LT050280322005012001T2-SC20190818204900", 
    "/mnt/cropmaskperm/unpacked_landsat_downloads/LT050310322005021001T1-SC20190818205059",
    "/mnt/cropmaskperm/unpacked_landsat_downloads/LT050290312005031601T1-SC20190818204935",  
    "/mnt/cropmaskperm/unpacked_landsat_downloads/LT050320312005011601T1-SC20190818205113",
]
labels_path = "/mnt/cropmaskperm/external/nebraska_pivots_projected.geojson"

setup_dirs(param_path)


# this is just to get the train dir path
wflow = PreprocessWorkflow(param_path, 
                             scene_list[0],
                             labels_path)

results = []
for scene_path in scene_list:

    wflow = dask.delayed(PreprocessWorkflow)(param_path, scene_path, labels_path)
    
    band_list = dask.delayed(wflow.yaml_to_band_index)()
        
    product_list = dask.delayed(wflow.get_product_paths)(band_list)
        
    dask.delayed(wflow.load_meta_and_bounds)(product_list)

    dask.delayed(wflow.load_single_scene)(product_list)
        
    dask.delayed(wflow.stack_and_save_bands)()
        
    dask.delayed(wflow.negative_buffer_and_small_filter)(-31, 100)
        
    dask.delayed(wflow.grid_images)()
        
    dask.delayed(wflow.remove_from_gridded)()
        
    dask.delayed(wflow.move_chips_to_folder)()
        
    result = dask.delayed(wflow.connected_components)()

    results.append(result)
    

# https://docs.dask.org/en/stable/delayed-best-practices.html
from dask.distributed import Client, progress

client = Client()  # use dask.distributed by default

x = dask.compute(*results)  # start computation in the background
progress(x)      # watch progress  

so then I installed ipywidgets version 7.5.1 in my conda environment that contains Dask and got this error when running the same code again

tornado.application - ERROR - Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7f9d23efb898>>, <Task finished coro=<MultiProgressBar.listen() done, defined at /data/anaconda/envs/cropmask/lib/python3.7/site-packages/distributed/diagnostics/progressbar.py:238> exception=AttributeError("'MultiProgressWidget' object has no attribute 'elapsed_time'")>)
Traceback (most recent call last):
  File "/data/anaconda/envs/cropmask/lib/python3.7/site-packages/tornado/ioloop.py", line 743, in _run_callback
    ret = callback()
  File "/data/anaconda/envs/cropmask/lib/python3.7/site-packages/tornado/ioloop.py", line 767, in _discard_future_result
    future.result()
  File "/data/anaconda/envs/cropmask/lib/python3.7/site-packages/distributed/diagnostics/progressbar.py", line 282, in listen
    self._draw_stop(**response)
  File "/data/anaconda/envs/cropmask/lib/python3.7/site-packages/distributed/diagnostics/progressbar.py", line 381, in _draw_stop
    + "</div>"
AttributeError: 'MultiProgressWidget' object has no attribute 'elapsed_time'

I’m not sure what the issue is here, seems to be some sort of version conflict between packages or other internal issue since I’m not invoking the “elapsed_time” attribute directly.

I’m using jupyterlab version 1.0.9, python 3.7, and dask version 2.3

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gjoseph92commented, Oct 7, 2021

@rrpelgrim confusingly, client.compute and dask.compute are different. client.compute is non-blocking and returns Futures. dask.compute blocks until the computation is done and returns the actual results (not Futures).

1reaction
marbericommented, Jan 28, 2020

Also present in Dask 2.9.2. Just ran into this when trying to run on a machine where I would prefer not opening a webpage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dask Distributed produces AttributeError: 'HighLevelGraph ...
map(square, range(10)) on the Python3(3.8) interpreter. How can this issue be fixed? Seems like an internal error, Dask was acquired with pip ......
Read more >
distributed.diagnostics.progressbar - Dask documentation
__loop if loop is None: # If the loop is not running when this is called, the LoopRunner.loop # property will raise a...
Read more >
Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError : Object has no attribute ? [ Gift : Animated Search Engine ...
Read more >
AttributeError: 'module' object has no attribute and ImportError
This video covers the AttributeError : 'module' object has no attribute and ImportError: No module name errors in Python.
Read more >
'module' object has no attribute in 3minutes - YouTube
" AttributeError : object has no attribute "Understand how to trouble shoot the error message. Examples used in the video:When you append a ......
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