DoubleGremlin181 / RubiksCubeGym

OpenAI Gym environments for various twisty puzzles
MIT License
35 stars 7 forks source link

QObject::moveToThread: Current thread (0x556d30ff35c0) is not the object's thread (0x556d311f9d90). #2

Closed antoniosap closed 3 years ago

antoniosap commented 3 years ago

i have this code:

import gym
import rubiks_cube_gym

def main():
    env = gym.make('rubiks-cube-222-v0')
    env.reset(scramble="R U R' U' R' F R2 U' R' U' R U R' F'")

    for _ in range(4):
        env.render()
        print(env.step(1))
    env.render(render_time=0)
    env.close()

if __name__ == "__main__":
    main()

and


...
QObject::moveToThread: Current thread (0x556d30ff35c0) is not the object's thread (0x556d311f9d90).
Cannot move to target thread (0x556d30ff35c0)

QObject::moveToThread: Current thread (0x556d30ff35c0) is not the object's thread (0x556d311f9d90).
Cannot move to target thread (0x556d30ff35c0)

(3178426, -1, False, {'cube': array([ 0,  9,  2, 15,  4,  5,  6, 21, 16, 10,  1, 11, 12, 13, 14, 23, 17,
        7,  3, 19, 20, 18, 22,  8], dtype=uint8), 'cube_reduced': 'WRWGOOGYRBWBOOGYRGWBYBYR'})
(1542962, -1, False, {'cube': array([ 0, 21,  2, 23,  4,  5,  6, 18, 17, 16, 15, 11, 12, 13, 14,  8,  7,
       10,  9, 19, 20,  3, 22,  1], dtype=uint8), 'cube_reduced': 'WYWYOOGBRRGBOOGRGBRBYWYW'})
...

any ideas ?

DoubleGremlin181 commented 3 years ago

It seems like there is some issue with your OpenCV installation. This thread on Stack Overflow should be helpful.

Alternatively, you can change the render method to a text based by setting the parameter mode to ansi or rgb_array as follows: env.render(mode = 'ansi')

DoubleGremlin181 commented 3 years ago

Closing due to inactivity