RuntimeError: Function _TorchNNFunctionBackward returned an invalid gradient at index 0 - expected device cuda:0 but got cpu

Hi, I’m currently working on quantum-classical neural networks using PyTorch and qiskit. I’ve created VGG16 NN with extension of quantum neural network by Torch Connector.
When I try to train network on cuda I got an error:

RuntimeError: Function _TorchNNFunctionBackward returned an invalid gradient at index 0 - expected device cuda:0 but got cpu

I’ve push my model, input data and labels of them. What is the problem with it?
Thank you in advance.

Could you post a minimal, executable code snippet to reproduce the issue, please?

Thanks for response.
This is the code that I used for training

Also this is the model I’ve been using.