Skip to content

Instantly share code, notes, and snippets.

@aktech
Created March 29, 2021 21:48
Show Gist options
  • Select an option

  • Save aktech/f90d3632e9f60d5d119704a98f2de8f7 to your computer and use it in GitHub Desktop.

Select an option

Save aktech/f90d3632e9f60d5d119704a98f2de8f7 to your computer and use it in GitHub Desktop.
dask-error
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-10-3aaabe578c05> in <module>
----> 1 out.compute(scheduler="single-threaded")

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/base.py in compute(self, **kwargs)
    281         dask.base.compute
    282         """
--> 283         (result,) = compute(self, traverse=False, **kwargs)
    284         return result
    285 

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/base.py in compute(*args, **kwargs)
    563         postcomputes.append(x.__dask_postcompute__())
    564 
--> 565     results = schedule(dsk, keys, **kwargs)
    566     return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
    567 

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in get_sync(dsk, keys, **kwargs)
    526     """
    527     kwargs.pop("num_workers", None)  # if num_workers present, remove it
--> 528     return get_async(apply_sync, 1, dsk, keys, **kwargs)
    529 
    530 

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, **kwargs)
    493 
    494                 while state["ready"] and len(state["running"]) < num_workers:
--> 495                     fire_task()
    496 
    497             succeeded = True

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in fire_task()
    455                 )
    456                 # Submit
--> 457                 apply_async(
    458                     execute_task,
    459                     args=(

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in apply_sync(func, args, kwds, callback)
    515 def apply_sync(func, args=(), kwds={}, callback=None):
    516     """ A naive synchronous version of apply_async """
--> 517     res = func(*args, **kwds)
    518     if callback is not None:
    519         callback(res)

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    225         failed = False
    226     except BaseException as e:
--> 227         result = pack_exception(e, dumps)
    228         failed = True
    229     return key, result, failed

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    220     try:
    221         task, data = loads(task_info)
--> 222         result = _execute_task(task, data)
    223         id = get_id()
    224         result = dumps((result, id))

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/core.py in _execute_task(arg, cache, dsk)
    119         # temporaries by their reference count and can execute certain
    120         # operations in-place.
--> 121         return func(*(_execute_task(a, cache) for a in args))
    122     elif not ishashable(arg):
    123         return arg

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/optimization.py in __call__(self, *args)
    961         if not len(args) == len(self.inkeys):
    962             raise ValueError("Expected %d args, got %d" % (len(self.inkeys), len(args)))
--> 963         return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
    964 
    965     def __reduce__(self):

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/core.py in get(dsk, out, cache)
    149     for key in toposort(dsk):
    150         task = dsk[key]
--> 151         result = _execute_task(task, cache)
    152         cache[key] = result
    153     result = _execute_task(out, cache)

~/.conda/envs/sgkit-gpu-new/lib/python3.8/site-packages/dask/core.py in _execute_task(arg, cache, dsk)
    119         # temporaries by their reference count and can execute certain
    120         # operations in-place.
--> 121         return func(*(_execute_task(a, cache) for a in args))
    122     elif not ishashable(arg):
    123         return arg

<__array_function__ internals> in where(*args, **kwargs)

ValueError: operands could not be broadcast together with shapes (2,3) (1,) (3,3) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment