kamenbliznashki / normalizing_flows

Pytorch implementations of density estimation algorithms: BNAF, Glow, MAF, RealNVP, planar flows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

name 'optimizer_state' is not defined

manyfeatures opened this issue · comments

When I launch python planar_flow.py --train --target_potential=u_z1 --flow_length=2
I get an error

Traceback (most recent call last):
  File "planar_flow.py", line 291, in <module>
    if optimizer_state: optimizer.load_state_dict(optimizer_state)
NameError: name 'optimizer_state' is not defined

Optimizer state only needs to be loaded if we're restoring from a checkpoint. Thanks for pointing this out. I just committed a fix.