Type mismatch on model when using GPU

Sorry I don’ think I will have time to look into your specific code, considering it seems complicated. You can use standard debugger (e.g. pdb) to check the types at that line, and see where it went wrong.

Also, instead of modifying source, you can do a subclass, or just copying the def and make your own conv class, which will be much safer

Please try to use the same tensor as the input. Resize the input tensor and copy the image to that tensor in each iteration. That helps me in a similar situation.