Skip to content

Confusing UserWarning when using CouplingFlow: Gradients do not exist for variables #331

@vpratz

Description

@vpratz

Using CouplingFlow currently raises a warning from Keras, see for example this test log. As far as I can tell, it does not impact functionality, because we calculate the loss in a different fashion. Is this correct? If so, I think finding a way to suppress this warning would be great to avoid confusion.

tests/test_two_moons/test_two_moons.py::test_fit[inference_network='coupling_flow']
  /usr/share/miniconda/envs/test/lib/python3.11/site-packages/keras/src/optimizers/base_optimizer.py:735:
UserWarning: Gradients do not exist for variables ['coupling_flow_120/dual_coupling_1152/single_coupling_2304/mlp_3064/configurable_hidden_block_6752/projector', 'coupling_flow_120/dual_coupling_1152/single_coupling_2305/mlp_3065/configurable_hidden_block_6754/projector', 'coupling_flow_120/dual_coupling_1153/single_coupling_2306/mlp_3066/configurable_hidden_block_6756/projector', 'coupling_flow_120/dual_coupling_1153/single_coupling_2307/mlp_3067/configurable_hidden_block_6758/projector']
when minimizing the loss. If using `model.compile()`, did you forget to provide a `loss` argument?

Metadata

Metadata

Assignees

No one assigned

    Labels

    user interfaceChanges to the user interface and improvements in usability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions