@ptrblck if you add the following to just before line 567 : optimizer_current_policy = AdamW_on_Lion_Optimizer( params=current_policy.parameters(), lr=1e-3 ) , you will notice that params is a valid non-empty parameter list before it is passed into AdamW_on_Lion_Optimizer()
# Diagnostic code to check parameters
if not list(current_policy.parameters()):
print("No parameters in current_policy.")
else:
for idx, param in enumerate(current_policy.parameters()):
print(f"Param {idx}: requires_grad={param.requires_grad}")
if param.requires_grad:
print("There are parameters that require gradients.")
else:
print("No parameters require gradients.")
params is not actually empty when before it is first being passed into the AdamW_on_Lion_Optimizer() init function as current_policy.parameters() , so I am really confused on why it became empty when it went inside the init function.
@ptrblck : I wonder if you have any idea / comments / suggestions OR experienced something similar in your past experience ?