-
Notifications
You must be signed in to change notification settings - Fork 246
Description
I tried play with notebook from Github. Why I am getting following error when I run following cell:
`# assuming the previous cell was completed, this cell loads in the different initializations
# and calculates the average mean absolute error (mae)
from keras.models import load_model
eth_preds = []
bt_preds = []
for rand_seed in range(775,800):
temp_model = load_model('eth_model_randseed%d.h5'%rand_seed)
eth_preds.append(np.mean(abs(np.transpose(temp_model.predict(LSTM_test_inputs))-
(test_set['eth_Close'].values[window_len:]/test_set['eth_Close'].values[:-window_len]-1))))
temp_model = load_model('bt_model_randseed_%d.h5'%rand_seed)
bt_preds.append(np.mean(abs(np.transpose(temp_model.predict(LSTM_test_inputs))-
(test_set['bt_Close'].values[window_len:]/test_set['bt_Close'].values[:-window_len]-1))))_
Error
OSError Traceback (most recent call last)
in ()
7 bt_preds = []
8 for rand_seed in range(775,800):
----> 9 temp_model = load_model('eth_model_randseed_%d.h5'%rand_seed)
10 eth_preds.append(np.mean(abs(np.transpose(temp_model.predict(LSTM_test_inputs))-
11 (test_set['eth_Close'].values[window_len:]/test_set['eth_Close'].values[:-window_len]-1))))
~/anaconda3/lib/python3.6/site-packages/keras/models.py in load_model(filepath, custom_objects, compile)
231 return custom_objects[obj]
232 return obj
--> 233 with h5py.File(filepath, mode='r') as f:
234 # instantiate model
235 model_config = f.attrs.get('model_config')
~/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py in init(self, name, mode, driver, libver, userblock_size, swmr, **kwds)
267 with phil:
268 fapl = make_fapl(driver, libver, **kwds)
--> 269 fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
270
271 if swmr_support:
~/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
97 if swmr and swmr_support:
98 flags |= h5f.ACC_SWMR_READ
---> 99 fid = h5f.open(name, flags, fapl=fapl)
100 elif mode == 'r+':
101 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
OSError: Unable to open file (unable to open file: name = 'eth_model_randseed_775.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)