Tensorflow - Message: Optimization Loop Failure

Hello,



I noticed that, when I run the Backtest code of the Quantra Course "Deep Reinforcement Learning in Trading" on my Jupyter notebook, in the terminal appears the message "Optimization loop failed: operation was cancelled". The code anyway runs without an error message.



I googled the error and it seems to be something related with the hyperparameter "BATCH_SIZE". I tried to increase it, and the message into the terminal remains, but appears with different frequency.



Could someone help me to understand what is this message and how it is possible to solve it?



The Tensorflow version is 2.7.0.



Thanks

Hi Roberto,



With respect to deep reinforcement, there could be multiple reasons why the optimisation did happen. One of which could be the 'Batch_size'. Try reducing it to 1 to see if the warnings reduce, or increase. 



A few other reasons could be that the machine is not able to efficiently process the code, since machine learning models have been known to be computing resource intensive. You could take another look at the parameters and try tweaking them. You can also try going through TensorFlow's forum, where a similar query was asked. 



If the code is working, then you can choose to ignore it for now and check the output to see if works well.



Hope this helps.