GPU memory requirement calculation from network architecture
There is no good way of estimating GPU RAM requirement based the number of layers and the number of nodes at each layer. The operations at each layer and connections between layers matter. For example, a multilayer perceptron (MLP) will use less compute than a Convolutional Neural Network (CNN).
A better idea would be monitor GPU usage during training. If the GPU is a NVIDIA, NVIDIA System Management Interface (nvidia-smi) is built for monitoring and management.