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

run.py - TypeError: Argument 'obj' has incorrect type (expected list, got BoxList) #19

Open
brentzucker opened this issue Feb 19, 2018 · 1 comment

Comments

@brentzucker
Copy link

I am trying to get started with the project and I am getting the following error:

python run.py --name test
Traceback (most recent call last):
  File "run.py", line 57, in <module>
    main()
  File "run.py", line 50, in main
    env.train_and_test(agent, args.n_steps, args.n_tests, args.early_stop)
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 599, in train_and_test
    runner.run(timesteps=timesteps_each)
  File "/Users/bvz/Documents/tensorforce/tensorforce/execution/runner.py", line 126, in run
    state, terminal, reward = self.environment.execute(actions=action)
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 462, in execute
    custom = self.end_episode_score()
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 545, in end_episode_score
    sharpe = self.sharpe()
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 532, in sharpe
    diff = (pd.Series(totals.trade).pct_change() - pd.Series(totals.hold).pct_change())[1:]
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/series.py", line 227, in __init__
    raise_cast_failure=True)
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/series.py", line 2868, in _sanitize_array
    subarr = _possibly_convert_platform(data)
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/common.py", line 1002, in _possibly_convert_platform
    values = lib.list_to_object_array(values)
TypeError: Argument 'obj' has incorrect type (expected list, got BoxList)

I am working out of the memory branch.

I have installed all of the dependencies, gathered the data from kaggle, imported it into postgres, and updated the config.json.

Is this a data or dependency issue on my end?

@brentzucker
Copy link
Author

similar issue with running hypersearch.py ..

python hypersearch.py
Traceback (most recent call last):
  File "hypersearch.py", line 852, in <module>
    main()
  File "hypersearch.py", line 848, in main
    y_list=Y
  File "/Users/bvz/Documents/tforce_btc_trader/gp.py", line 193, in bayesian_optimisation2
    y_list.append(loss_fn(params))
  File "hypersearch.py", line 799, in loss_fn
    reward = hsearch.execute(vec2hypers(params))
  File "hypersearch.py", line 624, in execute
    env.train_and_test(agent, self.cli_args.n_steps, self.cli_args.n_tests, -1)
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 599, in train_and_test
    runner.run(timesteps=timesteps_each)
  File "/Users/bvz/Documents/tensorforce/tensorforce/execution/runner.py", line 126, in run
    state, terminal, reward = self.environment.execute(actions=action)
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 462, in execute
    custom = self.end_episode_score()
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 545, in end_episode_score
    sharpe = self.sharpe()
  File "/Users/bvz/Documents/tforce_btc_trader/btc_env.py", line 532, in sharpe
    diff = (pd.Series(totals.trade).pct_change() - pd.Series(totals.hold).pct_change())[1:]
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/series.py", line 227, in __init__
    raise_cast_failure=True)
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/series.py", line 2868, in _sanitize_array
    subarr = _possibly_convert_platform(data)
  File "/Users/bvz/anaconda3/lib/python3.6/site-packages/pandas/core/common.py", line 1002, in _possibly_convert_platform
    values = lib.list_to_object_array(values)
TypeError: Argument 'obj' has incorrect type (expected list, got BoxList)

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

1 participant