@cedrickchee The memory required by the network increases from 3 GB to about 25 GB after the finishing of the Primary caps layer and after Capslayer is called. I wonder why so. I'm not able to solve this issue. The batch size is (8,128,64,6) which is not too large. On checking through print statements it is the classes Capslayer and Agreement routing that are causing an issue. Please help me out.