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.

`No dispatch for <class 'numpy.ndarray'>`

See original GitHub issue

This deserialization error then caused https://github.com/dask/distributed/issues/7060:

2022-09-23 19:01:53,760 - distributed.protocol.core - CRITICAL - Failed to deserialize
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/distributed/protocol/core.py", line 158, in loads
    return msgpack.loads(
  File "msgpack/_unpacker.pyx", line 194, in msgpack._cmsgpack.unpackb
  File "/usr/local/lib/python3.9/site-packages/distributed/protocol/core.py", line 138, in _decode_default
    return merge_and_deserialize(
  File "/usr/local/lib/python3.9/site-packages/distributed/protocol/serialize.py", line 497, in merge_and_deserialize
    return deserialize(header, merged_frames, deserializers=deserializers)
  File "/usr/local/lib/python3.9/site-packages/distributed/protocol/serialize.py", line 426, in deserialize
    return loads(header, frames)
  File "/usr/local/lib/python3.9/site-packages/distributed/protocol/serialize.py", line 58, in dask_loads
    loads = dask_deserialize.dispatch(typ)
  File "/usr/local/lib/python3.9/site-packages/dask/utils.py", line 632, in dispatch
    raise TypeError(f"No dispatch for {cls}")
TypeError: No dispatch for <class 'numpy.ndarray'>

AFAICT, NumPy was installed on the worker. There are plenty of other NumPy keys in memory on the same worker. So I’m not sure why this happened.

Unfortunately, I don’t have more information here. Not sure how easily reproducible it is.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
quasibencommented, Oct 4, 2022
1reaction
zklauscommented, Oct 5, 2022

Just to comment that I have put a PR up at dask/dask#9544 that addresses the problem for me locally. It is a very rough draft, but I’d be interested to know if you think that general approach is worth pursuing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NEP 18 — A dispatch mechanism for NumPy's high level array ...
In NumPy 1.16, you need to set the environment variable NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1 before importing NumPy to test NumPy function ...
Read more >
Numpy use dispatcher for argument displacement
My problem is not really specific to the einsum dispatcher. But it looks it is not possible for the dispatcher to rearrange the...
Read more >
Error with dd.utils.make_meta #7731 - dask/dask - GitHub
The error happens only with 2021.05.01 , works fine with 2021.05.0 . Versions. dask/distributed version: '2021.05.1' install method: pip.
Read more >
doc/dispatch.py · alkaline-ml/numpy - Gemfury
_dispatch_mechanism: Numpy's dispatch mechanism, introduced in numpy version v1.16 is the recommended approach for writing custom N-dimensional array ...
Read more >
Dask and the __array_function__ protocol
In short, the protocol allows a NumPy function call to dispatch the ... in a Dask array as a view ( asarray=True )...
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