Closed pakk-minidose closed 2 years ago
Hello and thank you for your issue!
I have unfortunately not used Flux or Zygote for quite a while and will likely have a hard time finding time to fix issues with this package at the moment. If you manage to solve it, feel free to submit a PR and I'll merge it, otherwise might take a while.
Best regards, Fredrik
Hello, Thank you for your reply. I will try to find some time to fix the issue.
Best regards, Dominik
Hello, I have encountered the following issue. When trying the code below
the last line of code produces
AssertionError: length(v) == veclength(grads)
.I have tracked down the issue to some non-params related entries appearing in the gradients:
There are two dictionaries and one buffer, which are not
GlobalRef
type, yet these do not correspond to the model parameters. These trigger the assertion https://github.com/baggepinnen/FluxOptTools.jl/blob/2a1d2210057efce7b380308a4ad2c4a11b04c174/src/FluxOptTools.jl#L17In this case, the corresponding dictionary entries are empty, but this may not be a general rule to detect this sort of entries.
The issue seems closely related to https://github.com/baggepinnen/FluxOptTools.jl/issues/9 . I think we need a function which cherry picks keys of the
grad.grads
dictionary corresponding to theparams
of the model, which would then solve both the issues.Thank you for any help.