google-deepmind / dm_control

Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo.
Apache License 2.0
3.76k stars 666 forks source link

mocap_demo error (matplotlib problem?): [GLFWApplication _setup:]: unrecognized selector sent to instance 0x10f0b3ae0 #80

Closed bibbygoodwin closed 4 years ago

bibbygoodwin commented 5 years ago

Currently something in the package is resulting in this error when I run the mocap_demo script. The error seems to be the same as #deepmind/dm_control#62, and given that the author of that issue put it down to something involving matplotlib it is possible that this is the root cause.

One of the replies to that issue from @saran-t (https://github.com/deepmind/dm_control/issues/62#issuecomment-438239756_) failed to reproduce the error because, it seems, they ran into the more standard matplotlib on OSX in virtualenvs problem, where a "ImportError: Python is not installed as a framework." error is thrown. If @saran-t sets the matplotlib backend to 'TkAgg' following the solution here: https://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python then they should be able to reproduce this error?

The minimal script required to trigger the error:

import matplotlib.pyplot as plt
from dm_control.suite import humanoid_CMU
env = humanoid_CMU.run()
fig = plt.figure()

If instead I call the last 2 lines in the other order I get no error i.e.

import matplotlib.pyplot as plt
from dm_control.suite import humanoid_CMU
fig = plt.figure()
env = humanoid_CMU.run()

Output:

2019-03-01 15:48:11.586 python3.5[63999:14891108] -[GLFWApplication _setup:]: unrecognized selector sent to instance 0x108141cb0
2019-03-01 15:48:11.588 python3.5[63999:14891108] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GLFWApplication _setup:]: unrecognized selector sent to instance 0x108141cb0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010010e2db __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x0000000100dbfc76 objc_exception_throw + 48
    2   CoreFoundation                      0x00000001001a6db4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x0000000100084820 ___forwarding___ + 1456
    4   CoreFoundation                      0x00000001000841e8 _CF_forwarding_prep_0 + 120
    5   Tk                                  0x0000000110703318 TkpInit + 467
    6   Tk                                  0x0000000110682252 Tk_Init + 1710
    7   _tkinter.cpython-35m-darwin.so      0x000000011055fdcd Tcl_AppInit + 77
    8   _tkinter.cpython-35m-darwin.so      0x000000011055d7d9 _tkinter_create + 889
    9   Python                              0x00000001007b8f59 PyCFunction_Call + 233
    10  Python                              0x00000001008450e8 PyEval_EvalFrameEx + 36648
    11  Python                              0x0000000100845cf0 _PyEval_EvalCodeWithName + 2368
    12  Python                              0x0000000100845df7 PyEval_EvalCodeEx + 71
    13  Python                              0x0000000100793c7a function_call + 186
    14  Python                              0x0000000100761643 PyObject_Call + 99
    15  Python                              0x000000010077c64c method_call + 140
    16  Python                              0x0000000100761643 PyObject_Call + 99
    17  Python                              0x00000001007d6291 slot_tp_init + 81
    18  Python                              0x00000001007ccf24 type_call + 212
    19  Python                              0x0000000100761643 PyObject_Call + 99
    20  Python                              0x000000010083dfa6 PyEval_EvalFrameEx + 7654
    21  Python                              0x00000001008447a8 PyEval_EvalFrameEx + 34280
    22  Python                              0x0000000100845cf0 _PyEval_EvalCodeWithName + 2368
    23  Python                              0x0000000100845df7 PyEval_EvalCodeEx + 71
    24  Python                              0x0000000100793c7a function_call + 186
    25  Python                              0x0000000100761643 PyObject_Call + 99
    26  Python                              0x000000010084161e PyEval_EvalFrameEx + 21598
    27  Python                              0x0000000100845cf0 _PyEval_EvalCodeWithName + 2368
    28  Python                              0x0000000100844086 PyEval_EvalFrameEx + 32454
    29  Python                              0x0000000100845cf0 _PyEval_EvalCodeWithName + 2368
    30  Python                              0x0000000100845e51 PyEval_EvalCode + 81
    31  Python                              0x000000010087411e PyRun_FileExFlags + 206
    32  Python                              0x00000001008743bf PyRun_SimpleFileExFlags + 447
    33  Python                              0x000000010088d178 Py_Main + 3512
    34  python3.5                           0x0000000100000e32 python3.5 + 3634
    35  python3.5                           0x0000000100000c84 python3.5 + 3204
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
TianhongDai commented 5 years ago

@bibbygoodwin Hi, what i suggest is trying to use cv2 to do the visualisation

import cv2
...

for i in range(max_frame):
  cv2.imshow('demo', video[i])
  cv2.waitKey(100)
alimuldal commented 4 years ago

Closing due to inactivity