Submission Error : Inference Failed

I keep getting an Inference failed error when I try to submit the notebook. I am not able to figure out how to fix this.
Thanking You
Shreesha G Bhat

Earlier I was using the old notebook. Despite changing the notebook to the modified one, I am still getting this problem. Kindly look into this, as inference failed submissions also seem to be counting towards the submission limit.
Shreesha G Bhat

Hi @shreesha_g_bhat_cs18

Seems like the error is due to RAM usage of your code. The evaluations run with a limit of 4 GB RAM, please make sure to run within this limit.

Some garbage collection code in python might help.

@dipam_chakraborty we were able to run it successfully initially but after trying it again it is consistently giving the same error Inference failed. Not sure what the issue is. Could you help out/