For the first question, if you put a sample code, we can help you more. It is because of shape mismatching
For the second question, when you increase batch size your gpu memory is not enough for that. you need to decrease batch size. Some times your memory is busy with some other stuff and by rebooting maybe you can solve the problem. But in general you need to decrease batch size or size of network …