Skip to content

Import error when running recently added 'discrete_cql_online.py' from examples/cql #1725

Closed
@spallaccini

Description

@spallaccini

Hi, when attempting to run the example on the Discrete CQL algorithm (online) discrete_cql_online.py I experienced an import issue for the DiscreteCQLLoss class from torchrl/objectives/utils.py.

Issue can be reproduced both running directly the script or isolating the import in a jupyter notebook as below:
from torchrl.objectives import CQLLoss, DiscreteCQLLoss, SoftUpdate

ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from torchrl.objectives import CQLLoss, DiscreteCQLLoss, SoftUpdate

ImportError: cannot import name 'DiscreteCQLLoss' from 'torchrl.objectives'

I tried installing both torchrl and torchrl-nighly; other than this tiny issue the library is working perfectly for me.

The CQLLoss class is correctly imported.

I found that the Discrete CQL had been recently added:
#1666

Thank you!

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