I think i have made silly mistake and not assign the GPU. Let me explain the flow.
NOTE: “model1” is defined as
from abc import ABC
class model1(ABC):
I am modifying existing code. I try to explain it in simple manner.
I create model in train.py by taking instance of class “model1”. “model1” doesn’t contain CNN. From “model1” i am passing image to CNN which return float tensor with cuda. Now i want to do post processing in “model1”. So want to do convolution as post processing with the image returned by CNN. Thats the line where the issue comes.
In train.py i created instance of “model1” and tried to assign cuda by writing
(1)  model.cuda() it shows AttributeError: ‘model’ object has no attribute ‘cuda’
(2)  model.to(‘cuda’) it shows " ‘model’ object has no attribute ‘to’
How can i check model is running on cpu or gpu? Writing “print(self.device)” in forward function of “module1” is my mistake i think so.