Skip to content

May I ask why ray remote can not send dict? #108

@lucasjinreal

Description

@lucasjinreal

I have a gather Actor which takes all outputs of previous Actor:

@ray.remote
class GatherAll:

    def __init__(self) -> None:
        pass

    # def infer(self, hands, kpts):
    #     if hands.shape[0] > kpts.shape[0]:
    #         out = hands.copy()
    #         out[:kpts.shape[0], :] += kpts[..., :4]
    #         return out
    #     else:
    #         out = kpts.copy()[..., :4]
    #         out[:hands.shape[0], :] += hands
    #         return out

    def infer(self, datas):
        hands = datas['a']
        kpts = datas['b']
        if hands.shape[0] > kpts.shape[0]:
            out = hands.copy()
            out[:kpts.shape[0], :] += kpts[..., :4]
            return out
        else:
            out = kpts.copy()[..., :4]
            out[:hands.shape[0], :] += hands
            return out

the uncommented parts not work, which I call it in dict:

# out = G.infer.remote(hands, kpts)
out = G.infer.remote({'a': hands, 'b': kpts})

Get error:

AttributeError: 'ray._raylet.ObjectRef' object has no attribute 'shape'

Why using separated is OK, but dictionary is not ? Very confused here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions