More than 32 Gb RAM is required to train the entire dataset. Code for training the entire dataset: https://www.kaggle.com/mmelahi/organic-chemistry-reaction-prediction?scriptVersionId=7438604
Spaces should be added. "N C @ @ H C ( = O ) O . S = C = S". Also, I've not trained the model on the entire dataset, which has nearly 1 million reactions. I've used only 10,000 reactions of small length.
I have used tensorflow as the backend to keras. So, try installing tensorflow.