You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, it seems I get an error if I import anything from sbi.neural_nets without importing something else first. I discovered this when I attempted to just import posterior_nn via from sbi.neural_nets import posterior_nn and I got
ImportError: cannot import name 'classifier_nn' from partially initialized module 'sbi.neural_nets.factory' (most likely due to a circular import) (../lib/python3.9/site-packages/sbi/neural_nets/factory.py)
Same thing happens if I just do import sbi.neural_nets or from sbi.neural_nets.embedding_nets import FCEmbedding
The error goes away if I import other things first, e.g., from sbi.analysis import pairplot from sbi.inference import NPE, simulate_for_sbi from sbi.utils import BoxUniform from sbi.diagnostics import check_sbc, run_sbc, check_tarp, run_tarp
It took me a while to debug this so I thought I'd report it here.
The text was updated successfully, but these errors were encountered:
The issue is fixed on the current main and most recent release, 0.23.3.
However, there are still some circular imports. I did improve our tests on circular imports to detect these kind of errors and try to resolve them in #1357.
Hello, it seems I get an error if I import anything from
sbi.neural_nets
without importing something else first. I discovered this when I attempted to just importposterior_nn
viafrom sbi.neural_nets import posterior_nn
and I gotSame thing happens if I just do
import sbi.neural_nets
orfrom sbi.neural_nets.embedding_nets import FCEmbedding
The error goes away if I import other things first, e.g.,
from sbi.analysis import pairplot
from sbi.inference import NPE, simulate_for_sbi
from sbi.utils import BoxUniform
from sbi.diagnostics import check_sbc, run_sbc, check_tarp, run_tarp
It took me a while to debug this so I thought I'd report it here.
The text was updated successfully, but these errors were encountered: