Giter VIP home page Giter VIP logo

protorl's Issues

Problem with latest opencv-python (4.8.1.78)

It seems that the opencv-pycharm 4.8.1.78 have some issues. I changed setup.py to use opencv-python==4.7.0.72 and it fixed the problem.

Traceback (most recent call last):
File "/home/jason/github_projects/ProtoRL/protorl/examples/dqn.py", line 5, in
from protorl.wrappers.common import make_env
File "/home/jason/github_projects/ProtoRL/protorl/wrappers/common.py", line 1, in
import gym
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/init.py", line 15, in
from gym.envs import make, spec, register
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/init.py", line 1, in
from gym.envs.registration import load_env_plugins as _load_env_plugins
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/envs/registration.py", line 24, in
from gym.wrappers import (
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/init.py", line 3, in
from gym.wrappers.atari_preprocessing import AtariPreprocessing
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/gym/wrappers/atari_preprocessing.py", line 8, in
import cv2
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 175, in bootstrap
if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/init.py", line 28, in __load_extra_py_code_for_module
py_module = importlib.import_module(module_name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/jason/github_projects/ProtoRL/venv/lib/python3.10/site-packages/cv2/typing/init.py", line 69, in
NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable

seems like dqn use_dueling = True is broken

I changed the parameter in examples/dqn.py to this and I get an error:

def main():
    env_name = 'CartPole-v1'
    # env_name = 'PongNoFrameskip-v4'
    use_prioritization = True
    use_double = False
    use_dueling = True
    # use_dueling = False
    # use_atari = True
    use_atari = False
Traceback (most recent call last):
  File "/home/jason/github_projects/ProtoRL/protorl/examples/dqn.py", line 41, in <module>
    main()

File "/home/jason/github_projects/ProtoRL/protorl/examples/dqn.py", line 37, in main
    scores, steps_array = ep_loop.run(n_games)

File "/home/jason/github_projects/ProtoRL/protorl/loops/single.py", line 34, in run
    self.agent.update()

File "/home/jason/github_projects/ProtoRL/protorl/agents/dqn.py", line 46, in update
    q_pred = self.q_eval.forward(states)[indices, actions]
TypeError: tuple indices must be integers or slices, not tuple

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.