Solved by MariosOreo in post #2 
              
              
                Hi, 
model.parameters() and model.modules() are both generator, firstly you could get the list of parameters and modules by list(model.parameters()) and then passing the weights and the loss module in a append to list method. 
But model.modules() get submodules in a iteration way, so there will be s…