Open jroulet opened 2 months ago
Hi there, thanks for reporting this! We are aware of this issue and, technically, it is already fixed. However, you are still getting the error because we had to keep imports in sbi.utils
purely for backwards compatibility (to still allow from sbi.utils import posterior_nn
). We will remove that import in the next major release and the bug will go away.
As you already suggest, the simplest fix is to first import the inference class (or first import sbi.utils
), e.g.
from sbi.inference import NPE
from sbi.neural_nets import posterior_nn
Describe the bug Hello, I got an
ImportError
when trying to importposterior_nn
fromneural_nets
.To Reproduce
sbi
version 0.23.1Expected behavior No error.
Additional context I can work around this by first importing
sbi.utils
.