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

OpenCV Error in cvtError #6

Open
tayrobin opened this issue May 30, 2016 · 3 comments
Open

OpenCV Error in cvtError #6

tayrobin opened this issue May 30, 2016 · 3 comments

Comments

@tayrobin
Copy link

tayrobin commented May 30, 2016

Hi there, (thanks for doing this, I'm so happy to be playing with Open AI's Gym..) I found this error on trying to run atari.py on the Go9x9-v0 game. I haven't had a problem with any Atari game yet, so it might just be on terminal games. Anyways, output below, and any help in getting this fixed would be appreciated! :

$ python atari.py --game Go9x9-v0 --train_steps 1000 --display true

[2016-05-30 12:46:32,188] Making new env: Go9x9-v0
Initializing Pachi engine uct with args threads=1,pondering=0

Initializing Pachi engine uct with args threads=1,pondering=0
To play: black
Move:   0  Komi: 0.0  Handicap: 0  Captures B: 0 W: 0
      A B C D E F G H J  
    +-------------------+
  9 | . . . . . . . . . |
  8 | . . . . . . . . . |
  7 | . . . . . . . . . |
  6 | . . . . . . . . . |
  5 | . . . . . . . . . |
  4 | . . . . . . . . . |
  3 | . . . . . . . . . |
  2 | . . . . . . . . . |
  1 | . . . . . . . . . |
    +-------------------+
OpenCV Error: Assertion failed (depth == CV_8U || depth == CV_16U || depth == CV_32F) in cvtColor, file /tmp/opencv20160107-29960-t5glvv/opencv-2.4.12/modules/imgproc/src/color.cpp, line 3644
Traceback (most recent call last):
  File "atari.py", line 72, in <module>
    Trainer(agent).run()
  File "/Game-AI/train.py", line 15, in run
    self.agent.randomRestart()
  File "/Game-AI/dqn.py", line 74, in randomRestart
    state = self.env.getScreen()
  File "/Game-AI/environment.py", line 31, in getScreen
    return cv2.resize(cv2.cvtColor(self.observation, cv2.COLOR_BGR2GRAY), self.dims)
cv2.error: /tmp/opencv20160107-29960-t5glvv/opencv-2.4.12/modules/imgproc/src/color.cpp:3644: error: (-215) depth == CV_8U || depth == CV_16U || depth == CV_32F in function cvtColor
@tharuniitk
Copy link

@tayrobin I am facing the same error while converting RGB to grayscale iamge..please help!!!

@ashwanijha04
Copy link

Same issue.

@nirupdharshan
Copy link

I am not sure about Go9x9-v0, but some games like CartPole does not return the pixel value as observation.. For CartPole, the observation is actually position of cart, pole angle, cart velocity, pole angular velocity. Hence, the algorithm cannot render it. I think that is the issue with Go9x9-v0 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants