Solved by ptrblck in post #2 
              
              
                It seems you are passing the net argument as a None so check where net is created and that it holds a valid nn.Module object. 
My guess would be that you might be using a convenient function to create the model and might have forgotten to return the model itself. E.g. this would break with the same …