Lightning-Universe / lightning-bolts

Toolbox of models, callbacks, and datasets for AI/ML researchers.
https://lightning-bolts.readthedocs.io
Apache License 2.0
1.7k stars 323 forks source link

Wrong import in tutorials for DQN #454

Closed drozzy closed 3 years ago

drozzy commented 3 years ago

Here: https://pytorch-lightning-bolts.readthedocs.io/en/latest/reinforce_learn.html#dqn-results

It should be: from pl_bolts.models.rl.dqn_model import DQN

and not: from pl_bolts.models.rl import DQN

github-actions[bot] commented 3 years ago

Hi! thanks for your contribution!, great first issue!

hassiahk commented 3 years ago

Hey @drozzy, you can actually do it both ways. In the __init__.py, DQN is already imported like below so you can also import like from pl_bolts.models.rl import DQN instead of from pl_bolts.models.rl.dqn_model import DQN. Hope this makes sense. https://github.com/PyTorchLightning/pytorch-lightning-bolts/blob/58536c260e7877c8c75dfccfaa58acee4fdc2ae1/pl_bolts/models/rl/__init__.py#L1-L3

drozzy commented 3 years ago

Oh, strange. I got import error when I did it the tutorial way.

drozzy commented 3 years ago

Nevermind, it works now. Thanks!