Solved by marziehoghbaie in post #4 
              
              
                Thanks, I could not use this solution, because the model is previously saved by someone else and I just want to test it. However, I found the solution by changing the model to the following: 
self.model = self.model.module.cpu() 
More info can be found in the following issue: