No such file directory
Ariunbileg0626 opened this issue · 3 comments
Exception has occurred: OSError
Unable to open file (unable to open file: name = 'results\2020-05-21_AAPL-huber_loss-adam-LSTM-seq-70-step-1-layers-3-units-256.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
model.load_weights(model_path)
AttributeError Traceback (most recent call last)
in
1 # evaluate the model
2 mse, mae = model.evaluate(data["X_test"], data["y_test"], verbose=0)
----> 3 mean_absolute_error = data["column_scaler"]["adjclose"].inverse_transform(mae.shape(1, -1))[0][0]
4 print("Mean Absolute Error:", mean_absolute_error)
AttributeError: 'float' object has no attribute 'shape'
I have the same error : AttributeError: 'float' object has no attribute 'shape'
Hey @Ariunbileg0626
You may convert mea to NumPy Array then you can reshape! like:
- np.array(mae).reshape(1,-1)...
I have updated the code now, recent versions of TensorFlow's model.evaluate() returns a Python float instead of numpy.float32, I've updated the code to work on both!
@cappittall 's solution is useful as well, thanks!