facebookresearch / Pearl

A Production-ready Reinforcement Learning AI Agent Library brought by the Applied Reinforcement Learning team at Meta.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when running the Single Item Recommender System Notebook

davera-017 opened this issue · comments

Hi, I'm trying to run the notebook on how to use Pearl for recommender systems, but when I run the online_learning() function I keep getting the same error, which I copy below:

    [161](Pearl/pearl/pearl_agent.py:161) if isinstance(safe_action_space, DiscreteActionSpace):
--> [162](Pearl/pearl/pearl_agent.py:162)     self._latest_action = safe_action_space.actions_batch[int(action.item())]
    [163](Pearl/pearl/pearl_agent.py:163) else:
    [164](Pearl/pearl/pearl_agent.py:164)     self._latest_action = action

RuntimeError: a Tensor with 100 elements cannot be converted to Scalar

On the other hand, I'm having a hard time understanding how the environment is being built. Could someone please explain further how they are creating the RecEnv object?

I am debugging this and will let you know as soon as possible.

Update: we've identified the bug and are currently working on a solution. Should be out today or tomorrow.

Update: started the fix but it had a wider range than initially expected. It might take a few days to get everything set correctly.

Update: we've fixed the bug but we don't see the same learning behavior as previously observed, so now we are working on identifying the cause of that.

Glad to let you know this has been finally fixed! It took a few iterations and the removal of a couple of issues.