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

Possible bug in dataloader.py #13

Open
oscarberonius opened this issue Oct 29, 2018 · 5 comments
Open

Possible bug in dataloader.py #13

oscarberonius opened this issue Oct 29, 2018 · 5 comments

Comments

@oscarberonius
Copy link

oscarberonius commented Oct 29, 2018

Hi,

I ran into a problem when I tried running the new core. I successfully built the PPO agent, but when I executed an eval session I received the following exception.

#PRINT# lines.split(sep) = ['20180701000108', '5467.87', '0.062', '56.86932808248668', '1.828228906843833', '0.12368473729161092', '5468.798899294792', '5457.467818250765', '5444.815160592744']
Traceback (most recent call last):
  File "run.py", line 42, in <module>
    session.loadSession()
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/session/local.py", line 71, in loadSession
    self.initEnv()
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/session/local.py", line 102, in initEnv
    logger=self.logger, saver=self.saver, dataloader=self.dl)
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/local_env.py", line 84, in __init__
    self.dl.loadFile()
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/base/dataloader.py", line 177, in loadFile
    tmp_data, tmp_raw, tmp_time = self.getStockDataVec(self.files[self.files_index])
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/base/dataloader.py", line 150, in getStockDataVec
    df.columns = names
UnboundLocalError: local variable 'names' referenced before assignment

I'm not sure if the code is supposed to be able to handle a row length of 10 or not, but there shouldn't be any problem with the data as I tested it before and made sure the path is correct.

@kkuette
Copy link
Owner

kkuette commented Oct 29, 2018

the dataloader is supposed to handle 3,4,6 and 6 row. here is the getter function, i should add a setting in config/environnement.json to handle this kind of things.

Thanks for your support.

@oscarberonius
Copy link
Author

Before you reworked the core I could use the same data to train the model. Did you remove that functionality?

@kkuette
Copy link
Owner

kkuette commented Nov 1, 2018

I haven't removed that feature, i've just commented the last 3 names here. You can uncomment it if you want, but take care about names if you are using complex network !

@oscarberonius
Copy link
Author

oscarberonius commented Nov 1, 2018

Okay. Can't try it out because I am getting all sorts of errors when trying to run the different modes. When I run the live session I now get

  File "run.py", line 40, in <module>
    product_id=product_id)
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/session/live.py", line 119, in initApi
    self.initEnv()
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/session/live.py", line 124, in initEnv
    logger=self.logger, saver=self.saver, dataloader=self.dl, api=self.api)
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/live_env.py", line 99, in __init__
    self.dl.loadHistorical()
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/base/dataloader.py", line 232, in loadHistorical
    ticks = self.formatTo15M(pd.DataFrame(ticks, columns=self.columns))
  File "/Users/Oscar/Documents/Cryptotrading/Tradz/TradzQAI/TradzQAI/core/environnement/base/dataloader.py", line 308, in formatTo15M
    for i in tqdm(range(len(data['Time'])), desc = "Formating : "):
NameError: name 'tqdm' is not defined

@kkuette
Copy link
Owner

kkuette commented Nov 1, 2018

I'm working on live session actually, there is alot of fix to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants