kengz/SLM-Lab

AttributeError: 'list' object has no attribute 'split'

Rockyyost opened this issue · 1 comments

I'm getting an error when running the following:

python run_lab.py slm_lab/spec/benchmark/reinforce/reinforce_cartpole.json

The error reads:

Traceback (most recent call last):
  File "run_lab.py", line 81, in <module>
    main()
  File "run_lab.py", line 70, in main
    read_spec_and_run(spec_file, spec_name, lab_mode)
  File "run_lab.py", line 52, in read_spec_and_run
    lab_mode, prename = lab_mode.split('@')
AttributeError: 'list' object has no attribute 'split'

Here is what I have in my lab environment:

# Name                    Version                   Build  Channel
atari-py                  0.2.6                    pypi_0    pypi
atomicwrites              1.3.0                      py_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
autopep8                  1.4.4                      py_0    conda-forge
box2d-py                  2.3.8                    pypi_0    pypi
bzip2                     1.0.8                h0b31af3_2    conda-forge
ca-certificates           2019.11.28           hecc5488_0    conda-forge
certifi                   2019.11.28               py37_0    conda-forge
cffi                      1.13.2           py37h33e799b_0    conda-forge
chardet                   3.0.4                    pypi_0    pypi
click                     7.0                      pypi_0    pypi
cloudpickle               0.5.2                    pypi_0    pypi
colorama                  0.4.3                    pypi_0    pypi
colorlog                  4.0.2                 py37_1000    conda-forge
colorlover                0.3.0                    pypi_0    pypi
coverage                  4.5.3            py37h1de35cc_0    conda-forge
decorator                 4.4.1                    pypi_0    pypi
et_xmlfile                1.0.1                   py_1001    conda-forge
filelock                  3.0.12                   pypi_0    pypi
flaky                     3.5.3                      py_0    conda-forge
flatbuffers               1.11                     pypi_0    pypi
freetype                  2.10.0               h24853df_1    conda-forge
funcsigs                  1.0.2                    pypi_0    pypi
future                    0.18.2                   pypi_0    pypi
gym                       0.12.1                   pypi_0    pypi
idna                      2.8                      pypi_0    pypi
importlib_metadata        1.4.0                    py37_0    conda-forge
intel-openmp              2019.4                      233  
ipython-genutils          0.2.0                    pypi_0    pypi
jdcal                     1.4.1                      py_0    conda-forge
jpeg                      9c                h1de35cc_1001    conda-forge
jsonschema                3.2.0                    pypi_0    pypi
jupyter-core              4.6.1                    pypi_0    pypi
libblas                   3.8.0               14_openblas    conda-forge
libcblas                  3.8.0               14_openblas    conda-forge
libcxx                    9.0.1                         1    conda-forge
libffi                    3.2.1             h6de7cb9_1006    conda-forge
libgcc                    4.8.5               hdbeacc1_10    conda-forge
libgfortran               3.0.1                         0    conda-forge
liblapack                 3.8.0               14_openblas    conda-forge
libopenblas               0.3.7                hd44dcd8_1    conda-forge
libpng                    1.6.37               h2573ce8_0    conda-forge
libprotobuf               3.11.2               hd174df1_0    conda-forge
libtiff                   4.1.0                ha78913b_3    conda-forge
lz4-c                     1.8.3             h6de7cb9_1001    conda-forge
markdown                  3.1.1                      py_0    conda-forge
mkl                       2019.4                      233  
more-itertools            8.1.0                      py_0    conda-forge
nbformat                  5.0.3                    pypi_0    pypi
ncurses                   6.1               h0a44026_1002    conda-forge
ninja                     1.9.0                ha1b3eb9_1    conda-forge
numpy                     1.16.3           py37hdf140aa_0    conda-forge
olefile                   0.46                       py_0    conda-forge
opencv-python             4.1.0.25                 pypi_0    pypi
openpyxl                  2.6.1                      py_0    conda-forge
openssl                   1.1.1d               h0b31af3_0    conda-forge
pandas                    0.24.2           py37h4f17bb1_1    conda-forge
pillow                    6.2.0            py37hb6f49c9_0    conda-forge
pip                       19.1.1                   py37_0    conda-forge
plotly                    3.9.0                    pypi_0    pypi
plotly-orca               1.2.1                         1    plotly
pluggy                    0.13.0                   py37_0    conda-forge
protobuf                  3.11.2           py37h4a8c4bd_0    conda-forge
psutil                    5.6.2            py37h01d97ff_0    conda-forge
py                        1.8.1                      py_0    conda-forge
pycodestyle               2.5.0                      py_0    conda-forge
pycparser                 2.19                     py37_1    conda-forge
pydash                    4.2.1                      py_0    conda-forge
pyglet                    1.4.9                    pypi_0    pypi
pyopengl                  3.1.0                    pypi_0    pypi
pyrsistent                0.15.7                   pypi_0    pypi
pytest                    4.5.0                    py37_0    conda-forge
pytest-cov                2.7.1                      py_0    conda-forge
pytest-timeout            1.3.3                      py_0    conda-forge
python                    3.7.3                h5c2c468_2    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
pytorch                   1.1.0                   py3.7_0    pytorch
pytz                      2019.3                     py_0    conda-forge
pyyaml                    5.1.2            py37h0b31af3_1    conda-forge
ray                       0.7.0                    pypi_0    pypi
readline                  8.0                  hcfe32e1_0    conda-forge
redis                     2.10.6                   pypi_0    pypi
regex                     2019.05.25       py37h01d97ff_0    conda-forge
requests                  2.22.0                   pypi_0    pypi
retrying                  1.3.3                    pypi_0    pypi
roboschool                1.0.46                   pypi_0    pypi
scipy                     1.3.0            py37hab3da7d_1    conda-forge
setuptools                45.0.0                   py37_1    conda-forge
six                       1.13.0                   py37_0    conda-forge
sqlite                    3.30.1               h93121df_0    conda-forge
tensorboard               1.14.0                   py37_0    conda-forge
tk                        8.6.10               hbbe82c9_0    conda-forge
traitlets                 4.3.3                    pypi_0    pypi
typing                    3.7.4.1                  pypi_0    pypi
ujson                     1.35            py37h0b31af3_1001    conda-forge
urllib3                   1.25.7                   pypi_0    pypi
wcwidth                   0.1.8                      py_0    conda-forge
werkzeug                  0.16.0                     py_0    conda-forge
wheel                     0.33.6                   py37_0    conda-forge
xlrd                      1.2.0                      py_0    conda-forge
xvfbwrapper               0.2.9                    pypi_0    pypi
xz                        5.2.4             h1de35cc_1001    conda-forge
yaml                      0.2.2                h0b31af3_1    conda-forge
zipp                      0.6.0                      py_0    conda-forge
zlib                      1.2.11            h0b31af3_1006    conda-forge
zstd                      1.4.4                he7fca8b_1    conda-forge

I can see where the error is, but I'm not sure how to fix it. The code assumes the lab_mode can be split by @, but lab_mode is a list with the full values:

[{'name': 'Reinforce', 'algorithm': {'name': 'Reinforce', 'action_pdtype': 'default', 'action_policy': 'default', 'center_return': True, 'explore_var_spec': None, 'gamma': 0.99, 'entropy_coef_spec': {'name': 'linear_decay', 'start_val': 0.01, 'end_val': 0.001, 'start_step': 0, 'end_step': 20000}, 'training_frequency': 1}, 'memory': {'name': 'OnPolicyReplay'}, 'net': {'type': 'MLPNet', 'hid_layers': [64], 'hid_layers_activation': 'selu', 'clip_grad_val': None, 'loss_spec': {'name': 'MSELoss'}, 'optim_spec': {'name': 'Adam', 'lr': 0.002}, 'lr_scheduler_spec': None}}]

Thanks!

Sorry, this was my mistake!