Chapter 7 - Error with enjoy_cartpole.py

Hello,

I am trying to complete the last step of Chapter 7 - using the trained mode to produce cartpole commands using the custom cartpole environment. I think I have the environment setup correctly, as I am able to run “python train_cartpole.py” and create the “cartpole_model.pkl” file. I get a VERY VERY long error that I have had little to no success debugging. I have had issues with the sim environment in the past, but have been able to work through them. Below, first you will find the is the executed command and the corresponding error and second you will find the enjoy_cartpole.py file:

  1. Executed Command && Error

     (openai_venv) user:~/catkin_ws/src/baselines/baselines/deepq/experiments$ python enjoy_cartpole.py
    
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint8 = np.dtype([("qint8", np.int8, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint16 = np.dtype([("qint16", np.int16, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint32 = np.dtype([("qint32", np.int32, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       np_resource = np.dtype([("resource", np.ubyte, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint8 = np.dtype([("qint8", np.int8, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint16 = np.dtype([("qint16", np.int16, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       _np_qint32 = np.dtype([("qint32", np.int32, 1)])
     /home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
       np_resource = np.dtype([("resource", np.ubyte, 1)])
     Logging to /tmp/openai-2019-09-14-21-15-05-250350
     [ERROR] [1568495707.032274, 0.000000]: SIMULATION RESET
     [WARN] [1568495707.043326, 0.000000]: PAUSING START
     [WARN] [1568495707.045079, 0.000000]: PAUSING service found...
     [WARN] [1568495707.045674, 0.000000]: PAUSING service calling...
     [WARN] [1568495707.050481, 0.000000]: PAUSING service calling...DONE
     [WARN] [1568495707.053793, 0.000000]: UNPAUSING START
     [WARN] [1568495707.057151, 0.000000]: UNPAUSING service found...
     [WARN] [1568495707.057519, 0.000000]: UNPAUSING service calling...
     [WARN] [1568495707.063052, 0.000000]: UNPAUSING service calling...DONE
     [WARN] [1568495707.073765, 0.012000]: PAUSING START
     [WARN] [1568495707.077451, 0.015000]: PAUSING service found...
     [WARN] [1568495707.083757, 0.018000]: PAUSING service calling...
     [WARN] [1568495707.092554, 0.025000]: PAUSING service calling...DONE
     [WARN] [1568495707.092927, 0.025000]: Start Init ControllersConnection
     [WARN] [1568495707.093413, 0.025000]: END Init ControllersConnection
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/tf_util.py:54: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.
    
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/tf_util.py:64: The name tf.ConfigProto is deprecated. Pleaseuse tf.compat.v1.ConfigProto instead.
    
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/tf_util.py:71: The name tf.InteractiveSession is deprecated.Please use tf.compat.v1.InteractiveSession instead.
    
     2019-09-14 21:15:07.112587: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
     2019-09-14 21:15:07.130798: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2900110000 Hz
     2019-09-14 21:15:07.131248: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x63c2440 executing computations on platform Host. Devices:
     2019-09-14 21:15:07.131817: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/misc_util.py:79: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
    
     Unexpected end of /proc/mounts line `overlay / overlay rw,relatime,lowerdir=l/QJ4HO35WIZTAX6B2G5BKHQA6PA:l/TP47HI33MQ2JT5VYIMKM64PO7M:l/7BNVTVE5D6Q3E3RUSQ2TEOLQ7P:l/4IUSJLZWG6OTVSTR7EUG7RTYR5:l/KUA6E2SWHB4SNEG5TRZSYK2XVP:l/4KBWELSLZAUHETYKVXP3EV3TQJ:l/W6IX4MUUAO63TMUS7DOZ33Y6L5:l/4NQEMAQ7DVRYLGCTBUMDCDGQYR:l/VSSCGDCAKD6NOJXJ3N5OFNX4RT:l/5Q4ID4XNF5NC6DFVGN5IINBFCY:l/TVIY2DEM65DLX2NQWVMVBQOELC:l/4DLMICT6Z4TGL3UYITAU7Q4H5K:l/NEPHHNNMM6S5GNV2MZCNKDUN3V:l/OIKG4AZFNSWUPTWRJ7S35JEFG3:l/XDY5K45A6HN63GNNIBHA3WN4II:l/QPAEHXIGNT43YZ3KJMGQLBHDNK:l/QSS235'
     Unexpected end of /proc/mounts line `VJX2TJVAE2KKM6FY2VNG:l/RBBGUYHPR3NTQM3EFFK3UXV5CF:l/BGOAY4JSTA6IQ2JJABYU75DHR2:l/FOKDASRXXFF7RNS6JNZLQXY3VP:l/RAS7YW32RYVNRBD7FNVHXGIYV3:l/GO4L7YR4VF3M444WZ7BIRR4YJY:l/AL3T4GCLV7BYR6D37JQ4DZKVIK:l/6P2Z5DA7RETSTGCKD26GGDTGEX:l/UQKT5D3ETA5625CEAVAJT24WAV:l/VF3N4OEYCSYW2IDKVQLPETLG4S:l/2KXUNW6FIRFRGS4MHRACAULQMF:l/KRNCKP5IWPQWTXSWK6F4R37LX7:l/ZHO5IYISB4CXLFYCEXQAQKMITV:l/36JMOP2FVZFETB7HPDBY3SAAMM:l/VVRJ6OQFG3I6GFJLPGCDRJADRW:l/L4YMEYGKRK6FUY5X6EXJ5JRJVB:l/SLC6IIYVSEZCJ7YFDWXTRMMNZI:l/EX44LCTXFC42EMHXIIPPPFIV'
     Unexpected end of /proc/mounts line `MC:l/MKSVFU4MG54VEMGSG34BOJB4XX:l/L7COSAGHI7FO3BE3E4U3A7BZXV:l/G4R3F4CLQFKY7NI7CGFFI6DBNH:l/GMKSDPTIF2Y7YXT6TNAEHQ6J5U:l/ZSPMSXAK4V2LPWMASDZXZ3CWOT:l/DVFMLSMY5QZJ3IHB27LJMF5MZ4:l/LPEVIJIZFPGCP2ZTJRCOEH2PK4:l/7GYPNON4BB3TDLMBRYACUPFA5J:l/TJSKHEGRTMXLIGPSS6TB3LHDPM:l/NXWLBD3W2E23KINO6S37AZLRNQ:l/43CPYU63AMDPILPKZYQVFTBNOA:l/IDIC5TOG4VWYDSTWH7THX5KDDK:l/L4B5BWVY5KBDLR2AFRM2IEWX6K:l/4V3ZUUAVTML5RW53LYR5XFOQ3J:l/MVYMPXZJ2ZZ55ALBR2OV7ZBISJ:l/J2QCWCEY4RQEZSMR7KN2BY73VS:l/A2VTYQQFPCPQHLJ3IHZC274XBE:l/V6ZJ4YUN7R76F'
     Unexpected end of /proc/mounts line `4RDOYFNHPSU7F:l/DMEYGVPNE7OI4P7SPENQCAGSLY:l/K3XVKNDI7CWJBXCWAL2WZVPCXJ:l/VIIYKLI6XBJ4O2MANV7GRAVUYZ:l/VUK3VMN7AFVK53PL7OZXI4EJZB:l/MGSL7MZ5NXGVIFY6H2DFBD4LDK:l/WUB37EVA4CH3UY553U4Y4KDRCE:l/RNM5X76A6IXKPKDSMOODDDV2TY:l/RM3GEM7UNE3B73XV3RP5CIGVF4:l/MHLXBDGOP5ZXYQPDH3WCQBKLAI:l/HFODSFYTBJVBGHPCD26DM77BUO:l/WPZHHXWJXWULYNZGWQJYPZEWD4:l/F6EA7UVUJLT4QXBJXV2NHWVUZO:l/OSNP3C35H5HOA435Y3LRGCVRWO:l/2AYG2YW3FUQXADAKIPTCS6IFCO:l/SLA7OA6FLZHWMBUCIOCFPKCIH4:l/7KYQKP7CXLRKFY4D7AC6IIF7OK:l/OMYEPEALGQTFB2EJ2DUAUKHUYQ:l/AE'
     Unexpected end of /proc/mounts line `HN24NLHVHEDQRFT6ODKRFBSQ:l/R3AGNA3S5XTWTQJMRWPDV4XID7:l/P7T32YYKM4NKJJYSYC2Z6MIYGR:l/JEDM5RVUHMLGWZGSQIWKNVMLVE:l/GJ5ZQW2JYAASRI3HFTTX6WN2HL:l/BBGLFLRC6UHV5SXVGEEJUNYYHD:l/4OZ46AWM2T6LSCIUK2QMPA6XMU:l/3C4HK7B6LZAWCTVI4XIJN6AJ4D:l/USAYOALKUNQY4QPEYLKPQF7KTM:l/4J24V2P4O5ZMBMWTUQ4XYG4L7U:l/R2WRYXCZZGFXW5J77VY2RZZG6O:l/UG5A5AER4CLZG3PQHGUQQWKCVY:l/QVXPXMBNTNKW4M3TDIJ7SP5MHJ:l/BDDJBPKVCQJTCKTIGEL2CNETXW:l/TXMASW3K6S6W2IZPLYJMOIWQ27:l/DYEH3CYCSWSTXNEN2RLWCUGAUK:l/ZIC2ALY6KRYJTZGIXE4HZCCD46:l/3UYTMYEQ3MEHFOWK2UVJ'
     --------------------------------------------------------------------------
     [[3916,1],0]: A high-performance Open MPI point-to-point messaging module
     was unable to find any relevant network interfaces:
    
     Module: OpenFabrics (openib)
       Host: rosdscomputer
    
     Another transport will be used instead, although this may result in
     lower performance.
     --------------------------------------------------------------------------
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/deepq/deepq.py:206: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.
    
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/deepq/build_graph.py:176: The name tf.variable_scope is deprecated.Please use tf.compat.v1.variable_scope instead.
    
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/input.py:57: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
     Instructions for updating:
     Use `tf.cast` instead.
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/models.py:50: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
     Instructions for updating:
     Use keras.layers.flatten instead.
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5da92897f0>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5da92897f0>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5da9289f98>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5da9289f98>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9818c240>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9818c240>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9818c240>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9818c240>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5da9289fd0>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5da9289fd0>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5da9289fd0>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5da9289fd0>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:From /home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/deepq/build_graph.py:189: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
     Instructions for updating:
     Use tf.where in 2.0, which has the same broadcast rule as np.where
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980bbf98>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980bbf98>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d98170e48>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d98170e48>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d980eba20>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d980eba20>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d981106d8>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d981106d8>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98110ac8>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98110ac8>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98110ac8>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98110ac8>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980bb7f0>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980bb7f0>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980eb518>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d980eb518>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9802d550>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9802d550>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9809dc88>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9809dc88>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9809dc88>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d9809dc88>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98062dd8>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d98062dd8>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d981709e8>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d981709e8>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d800aedd8>> could not be transformed and will beexecuted as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attachthe full output. Cause: converting <bound method Flatten.call of <tensorflow.python.layers.core.Flatten object at 0x7f5d800aedd8>>: AttributeError: module 'gast' has no attribute 'Num'
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061b70>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061b70>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061b70>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061b70>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061898>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d80061898>>: AssertionError: Bad argument number for Name: 3, expecting 4
     WARNING:tensorflow:Entity <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d980280b8>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach thefull output. Cause: converting <bound method Dense.call of <tensorflow.python.layers.core.Dense object at 0x7f5d980280b8>>: AssertionError: Bad argument number for Name: 3, expecting 4
     2019-09-14 21:15:14.094762: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
     [WARN] [1568495714.167856, 0.025000]: UNPAUSING START
     [WARN] [1568495714.172581, 0.025000]: UNPAUSING service found...
     [WARN] [1568495714.178371, 0.025000]: UNPAUSING service calling...
     [WARN] [1568495714.187425, 0.025000]: UNPAUSING service calling...DONE
     [WARN] [1568495714.265241, 0.096000]: PAUSING START
     [WARN] [1568495714.269429, 0.099000]: PAUSING service found...
     [WARN] [1568495714.275604, 0.101000]: PAUSING service calling...
     [WARN] [1568495714.283541, 0.109000]: PAUSING service calling...DONE
     [ERROR] [1568495714.287556, 0.110000]: SIMULATION RESET
     [WARN] [1568495714.295989, 0.110000]: UNPAUSING START
     [WARN] [1568495714.298894, 0.110000]: UNPAUSING service found...
     [WARN] [1568495714.300208, 0.110000]: UNPAUSING service calling...
     [WARN] [1568495714.307328, 0.110000]: UNPAUSING service calling...DONE
     [WARN] [1568495714.350087, 0.049000]: PAUSING START
     [WARN] [1568495714.356253, 0.055000]: PAUSING service found...
     [WARN] [1568495714.362604, 0.059000]: PAUSING service calling...
     [WARN] [1568495714.374194, 0.070000]: PAUSING service calling...DONE
     [WARN] [1568495714.374967, 0.074000]: PUBLISHING REWARD...
     [WARN] [1568495714.375578, 0.074000]: PUBLISHING REWARD...DONE=0,EP=0
     Traceback (most recent call last):
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1864, in _create_c_op
         c_op = c_api.TF_FinishOperation(op_desc)
     tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 4 and 2. Shapes are [256,4] and [256,2]. for 'Assign_7' (op: 'Assign') with input shapes: [256,4], [256,2].
    
     During handling of the above exception, another exception occurred:
    
     Traceback (most recent call last):
       File "enjoy_cartpole.py", line 32, in <module>
         main()
       File "enjoy_cartpole.py", line 18, in main
         act = deepq.learn(env, network='mlp', total_timesteps=0, load_path="cartpole_model.pkl") #~/catkin_ws/src/baselines/baselines/deepq/experiments/cartpole_model.pkl
       File "/home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/deepq/deepq.py", line 256, in learn
         load_variables(load_path)
       File "/home/user/.catkin_ws_python3/src/baselines_tc/baselines/baselines/common/tf_util.py", line 361, in load_variables
         restores.append(v.assign(loaded_params[v.name]))
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/ops/variables.py", line 1952, in assign
         name=name)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/ops/state_ops.py", line 227, in assign
         validate_shape=validate_shape)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/ops/gen_state_ops.py", line 66, in assign
         use_locking=use_locking, name=name)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
         op_def=op_def)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
         return func(*args, **kwargs)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
         op_def=op_def)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2027, in __init__
         control_input_ops)
       File "/home/user/.catkin_ws_python3/openai_venv/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1867, in _create_c_op
         raise ValueError(str(e))
     ValueError: Dimension 1 in both shapes must be equal, but are 4 and 2. Shapes are [256,4] and [256,2]. for 'Assign_7' (op: 'Assign') with input shapes: [256,4], [256,2].
    
  2. enjoy_cartpole.py

     import gym
     from baselines import deepq
     from openai_ros.task_envs.cartpole_stay_up import stay_up
     import rospy
     import numpy as np
     import os
    
     def main():
         # env = gym.make("CartPole-v0")
         rospy.init_node('cartpole_training', anonymous=True, log_level=rospy.WARN)
         env = gym.make("CartPoleStayUp-v0")
         act = deepq.learn(env, network='mlp', total_timesteps=0, load_path="cartpole_model.pkl") 
    
         while True:
             obs, done = env.reset(), False
             episode_rew = 0
             while not done:
                 # env.render()
                 # obs, rew, done, _ = env.step(act(obs[None])[0])
                 obs, rew, done, _ = env.step(act(np.array(obs)[None])[0])
                 episode_rew += rew
             print("Episode reward", episode_rew)
    
    
    if __name__ == '__main__':
         main()

#!/usr/bin/env python
import numpy as np
import gym
print(“GYM MODULE PATH==>”+str(gym.file))
from openai_ros.task_envs.cartpole_stay_up import stay_up
print(“STAY UP module==>”+str(stay_up.file))

from baselines import deepq

def main():
env = gym.make(“CartPoleStayUp-v0”)
act = deepq.learn(env, network=‘mlp’, total_timesteps=0, load_path=“cartpole_model.pkl”)

while True:
    obs, done = env.reset(), False
    episode_rew = 0
    while not done:
        #env.render()
        obs, rew, done, _ = env.step(act(np.array(obs)[None])[0])
        episode_rew += rew
    print("Episode reward", episode_rew)

if name == ‘main’:
main()

I tried this copying the structure of my training. But in my case I’m having another issue:

Current cartpole_v0/joint_states not ready yet, retrying for getting joint_states

So I’ll make an issue of this and we will work on it