Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: type 'Collector' is not subscriptable #1231

Open
8 tasks
jaried opened this issue Dec 22, 2024 · 1 comment
Open
8 tasks

TypeError: type 'Collector' is not subscriptable #1231

jaried opened this issue Dec 22, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@jaried
Copy link

jaried commented Dec 22, 2024

  • I have marked all applicable categories:
    • [] exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
    • design request (i.e. "X should be changed to Y.")
  • I have visited the source website
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:
    import tianshou, gymnasium as gym, torch, numpy, sys
    print(tianshou.__version__, gym.__version__, torch.__version__, numpy.__version__, sys.version, sys.platform)
1.1.0 0.28.1 2.5.1+cu124 1.26.4 3.11.0 | packaged by Anaconda, Inc. | (main, Mar  1 2023, 18:18:21) [MSC v.1916 64 bit (AMD64)] win32

train_collector = ts.data.Collector[CollectStats](

    train_collector = ts.data.Collector[CollectStats](
                      ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
TypeError: type 'Collector' is not subscriptable
@MischaPanch
Copy link
Collaborator

This happens because you are using the version of the script from master but a released tianshou version from pypi. You can either

  1. Install the latest version of tianshou from master
  2. Use the script from the version 1.1.0 (checkout the corresponding tag)
  3. Wait for release of 1.2.0, which will happen in February

@MischaPanch MischaPanch self-assigned this Jan 26, 2025
@MischaPanch MischaPanch added the question Further information is requested label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants