RL Model on Real World Price Data

I got error says. just try run it on mine computer.

OSError                                   Traceback (most recent call last)
<ipython-input-5-3b57ee0af746> in <module>
      4 `False` in `rl_config`
      5 """
----> 6 run(bars5m, rl_config)

~\AlpacaTrade\data_modules\quantra_reinforcement_learning.py in run(bars5m, rl_config)
    481         if not episode % 10:
    482             print('----saving weights, trade logs and replay buffer-----')
--> 483             r_network.save_weights(rl_config['WEIGHTS_FILE'], overwrite=True)
    484             trade_logs.to_pickle(rl_config['TRADE_FILE'])
    485             pickle.dump(exp_replay.memory, open(rl_config['REPLAY_FILE'], 'wb'))

~\anaconda3\envs\py36StockTradingRL\lib\site-packages\keras\engine\training.py in save_weights(self, filepath, overwrite, save_format, options)
   2249         return
   2250     if save_format == 'h5':
-> 2251       with h5py.File(filepath, 'w') as f:
   2252         hdf5_format.save_weights_to_hdf5_group(f, self.layers)
   2253     else:

~\anaconda3\envs\py36StockTradingRL\lib\site-packages\h5py\_hl\files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, **kwds)
    425                                fapl, fcpl=make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
    426                                fs_persist=fs_persist, fs_threshold=fs_threshold),
--> 427                                swmr=swmr)
    428 
    429             if isinstance(libver, tuple):

~\anaconda3\envs\py36StockTradingRL\lib\site-packages\h5py\_hl\files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
    194         fid = h5f.create(name, h5f.ACC_EXCL, fapl=fapl, fcpl=fcpl)
    195     elif mode == 'w':
--> 196         fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
    197     elif mode == 'a':
    198         # Open in append mode (read/write).

h5py\_objects.pyx in h5py._objects.with_phil.wrapper()

h5py\_objects.pyx in h5py._objects.with_phil.wrapper()

h5py\h5f.pyx in h5py.h5f.create()

OSError: Unable to create file (unable to open file: name = '../data_modules/indicator_model_price_data.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 302)

Hi Johan,



I am not able to replicate this issue. It is working fine on my system. Here are the steps that I followed to run the notebook on my local system:


  1. Download the zip file from this link.
  2. Run the RL_Model_on_Price_Data.ipynb notebook located inside the Performance_Analysis_Real_World_Data folder. 



    I was able to run the notebook successfully without any errors. However, if you followed any other steps or made changes to any of the parameters in the notebook, please do let us know so that we can investigate it and help debug the same.



    Thanks,

    Akshay

Good for you.