But it is not working, it can find only if the 1st layer is conv or not. I guess its mostly because for the BasicBlocks the nns are not directly having Conv2d as its children directly. So, the code is failing. Any suggestion?