Could you explain your use case a bit more?
If I understand the problem correctly, you’ve trained a model on MNIST and get a 99% accuracy.
Now you would like to retrain the model on another dataset, with single-channel image tensors having a spatial size of 28x28, but the accuracy is bad?
PS: Variables are deprecated since PyTorch 0.4 so you can use tensors now. You shouldn’t use the .data attribute, as it might yield unwanted side effects.