Skip to content

Conversation

@SermetPekin
Copy link

@SermetPekin SermetPekin commented Oct 24, 2025

Fix for issue

The error originates from this line in the Keras source code

# old signratures 
 @sanitize_input_shape
    def build(self, input_shape):
        self.call(keras.ops.zeros(input_shape))

    def call(self, input_set: Tensor, training: bool = False, **kwargs) -> Tensor:
        """Performs the forward pass of a learnable equivariant transform.
# new signatures
@sanitize_input_shape
    def build(self, input_set_shape):
        self.call(keras.ops.zeros(input_set_shape))

    def call(self, input_set: Tensor, training: bool = False, **kwargs) -> Tensor:
        """Performs the forward pass of a learnable equivariant transform.

On Windows with python 3.10.8
I get the error below.


FAILED tests/test_approximators/test_approximator_standardization/
test_approximator_standardization.py::test_save_and_load[standardize='all'] 
- ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix
 and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  
For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.

As I previously mentioned I got this error on Windows (which I could not reproduce with same packages on mac or ubuntu)
I created environment using

uv venv --python 3.10
.venv\Scripts\activate
uv pip install ".[all]"
uv run pytest -m "not slow"  

I checked with Mac and Ubuntu they pass successfully. (uv run pytest -m 'not slow')

absl-py==2.3.1
accessible-pygments==0.0.5
alabaster==1.0.0
anyio==4.11.0
argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0
arrow==1.4.0
asttokens==3.0.0
astunparse==1.6.3
async-lru==2.0.5
attrs==25.4.0
babel==2.17.0
bayesflow @ file:///C:/Users/Username/PycharmProjects/bf_orig/bayesflow-main
beautifulsoup4==4.14.2
bleach==6.2.0
cachetools==6.2.1
certifi==2025.10.5
cffi==2.0.0
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.4.4
click==8.3.0
colorama==0.4.6
comm==0.2.3
contourpy==1.3.2
coverage==7.11.0
cycler==0.12.1
debugpy==1.8.17
decorator==5.2.1
defusedxml==0.7.1
distlib==0.4.0
docutils==0.21.2
exceptiongroup==1.3.0
execnet==2.1.1
executing==2.2.1
fastjsonschema==2.21.2
filelock==3.20.0
flatbuffers==25.9.23
fonttools==4.60.1
fqdn==1.5.1
gast==0.6.0
google-pasta==0.2.0
greenlet==3.2.4
grpcio==1.76.0
h11==0.16.0
h5py==3.15.1
httpcore==1.0.9
httpx==0.28.1
identify==2.6.15
idna==3.11
imagesize==1.4.1
importlib-metadata==8.7.0
iniconfig==2.3.0
ipykernel==7.0.1
ipython==8.37.0
ipywidgets==8.1.7
isoduration==20.11.0
jedi==0.19.2
jinja2==3.1.6
json5==0.12.1
jsonpointer==3.0.0
jsonschema==4.25.1
jsonschema-specifications==2025.9.1
jupyter==1.1.1
jupyter-cache==1.0.1
jupyter-client==8.6.3
jupyter-console==6.6.3
jupyter-core==5.9.1
jupyter-events==0.12.0
jupyter-lsp==2.3.0
jupyter-server==2.17.0
jupyter-server-terminals==0.5.3
jupyterlab==4.4.10
jupyterlab-pygments==0.3.0
jupyterlab-server==2.28.0
jupyterlab-widgets==3.0.15
keras==3.11.3
kiwisolver==1.4.9
lark==1.3.0
latexcodec==3.0.1
libclang==18.1.1
line-profiler==5.0.0
markdown==3.9
markdown-it-py==3.0.0
markupsafe==3.0.3
matplotlib==3.10.7
matplotlib-inline==0.2.1
mdit-py-plugins==0.5.0
mdurl==0.1.2
mistune==3.1.4
ml-dtypes==0.5.3
myst-nb==1.3.0
myst-parser==4.0.1
namex==0.1.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nest-asyncio==1.6.0
nodeenv==1.9.1
notebook==7.4.7
notebook-shim==0.2.4
numpy==1.26.4
numpydoc==1.9.0
opt-einsum==3.4.0
optree==0.17.0
overrides==7.7.0
packaging==25.0
pandas==2.3.3
pandocfilters==1.5.1
parso==0.8.5
pillow==12.0.0
pip==22.2.2
platformdirs==4.5.0
pluggy==1.6.0
pre-commit==4.3.0
prometheus-client==0.23.1
prompt-toolkit==3.0.52
protobuf==6.33.0
psutil==7.1.1
pure-eval==0.2.3
pybtex==0.25.1
pybtex-docutils==1.0.3
pycparser==2.23
pydata-sphinx-theme==0.16.1
pygments==2.19.2
pyparsing==3.2.5
pyproject-api==1.10.0
pytest==8.4.2
pytest-cov==7.0.0
pytest-rerunfailures==16.1
pytest-xdist==3.8.0
python-dateutil==2.9.0.post0
python-json-logger==4.0.0
pytz==2025.2
pywinpty==3.0.2
pyyaml==6.0.3
pyzmq==27.1.0
referencing==0.37.0
requests==2.32.5
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rfc3987-syntax==1.1.0
rich==14.2.0
rpds-py==0.28.0
ruff==0.14.2
scipy==1.15.3
seaborn==0.13.2
send2trash==1.8.3
setuptools==63.2.0
six==1.17.0
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.8
sphinx==8.1.3
sphinx-design==0.6.1
sphinx-polyversion==1.1.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-bibtex==2.6.5
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sqlalchemy==2.0.44
stack-data==0.6.3
tabulate==0.9.0
tensorboard==2.20.0
tensorboard-data-server==0.7.2
tensorflow==2.20.0
termcolor==3.1.0
terminado==0.18.1
tinycss2==1.4.0
tomli==2.3.0
tornado==6.5.2
tox==4.31.0
tqdm==4.67.1
traitlets==5.14.3
typing-extensions==4.15.0
tzdata==2025.2
uri-template==1.3.0
urllib3==2.5.0
irtualenv==20.35.3
wcwidth==0.2.14
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.9.0
werkzeug==3.1.3
wheel==0.45.1
widgetsnbextension==4.0.14
wrapt==2.0.0
zipp==3.23.0

stefanradev93 and others added 5 commits August 27, 2025 03:43
* fix trainable parameters in distributions (bayesflow-org#520)

* Improve numerical precision in MVNScore.log_prob

* add log_gamma diagnostic (bayesflow-org#522)

* add log_gamma diagnostic

* add missing export for log_gamma

* add missing export for gamma_null_distribution, gamma_discrepancy

* fix broken unit tests

* rename log_gamma module to sbc

* add test_log_gamma unit test

* add return information to log_gamma doc string

* fix typo in docstring, use fixed-length np array to collect log_gammas instead of appending to an empty list

* Breaking changes: Fix bugs regarding counts in standardization layer (bayesflow-org#525)

* standardization: add test for multi-input values (failing)

This test reveals to bugs in the standarization layer:

- count is updated multiple times
- batch_count is too small, as the sizes from reduce_axes have to be
  multiplied

* breaking: fix bugs regarding count in standardization layer

Fixes bayesflow-org#524

This fixes the two bugs described in c4cc133:

- count was accidentally updated, leading to wrong values
- count was calculated wrongly, as only the batch size was used. Correct
  is the product of all reduce dimensions. This lead to wrong standard
  deviations

While the batch dimension is the same for all inputs, the size of the
second dimension might vary. For this reason, we need to introduce an
input-specific `count` variable. This breaks serialization.

* fix assert statement in test

* rename log_gamma to calibration_log_gamma (bayesflow-org#527)

* simple fix

* Hotfix: numercial stability of non-log-stabilized sinkhorn plan (bayesflow-org#531)

* fix numerical stability issues in sinkhorn plan

* improve test suite

* fix ultra-strict convergence criterion in log_sinkhorn_plan

* update dependencies

* add comment about convergence check

* update docsting to reflect fixes

* sinkhorn_plan now returns a transport plan with uniform marginal distributions

* add unit test for sinkhorn_plan

* fix sinkhorn function by sampling from the logits of the transpose of the plan, instead of the plan directly

* sinkhorn(x1, x2) now samples from log(plan) to receive assignments such that x2[assignments] matches x1

* re-enable test_assignment_is_optimal() for method='sinkhorn'

* log_sinkhorn now correctly uses log_plan instead of keras.ops.exp(log_plan), log_sinkhorn_plan returns logits of the transport plan

* add unit tests for log_sinkhorn_plan

* fix faulty indexing with tensor for tensorflow backend

* re-add numItermax for ot pot test

---------

Co-authored-by: Daniel Habermann <133031176+daniel-habermann@users.noreply.github.com>

* isinstance sequence

* Pass correct training stage in compute_metrics (bayesflow-org#534)

* Pass correct training stage in CouplingFlow.compute_metrics

* Pass correct training stage in CIF and PointInferenceNetwork

* Custom test quantity support for calibration_ecdf (bayesflow-org#528)

* Custom test quantity support for calibration_ecdf

* rename variable [no ci]

* Consistent defaults for variable_keys/names in calibration_ecdf with test quantiles

* Tests for calibration_ecdf with test_quantities

* Remove redundant and simplify comments

* Fix docstrings and typehints

---------

Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>

* Log gamma test fix (bayesflow-org#535)

* fix test_calibration_log_gamma_end_to_end unit test failing too often than expected

* set alpha to 0.1% in binom.ppf

* fix typo in comment

* Stateless adapters (bayesflow-org#536)

* Remove stateful adapter features

* Fix tests

* Fix typo

* Remove nnpe from adapter

* Bring back notes [skip ci]

* Remove unncessary restriction to kwargs only [skip ci]

* Remove old super call [skip ci]

* Robustify type [skip ci]

* remove standardize from multimodal sim notebook [no ci]

* add draft module docstring to augmentations module [no ci]

Feel free to modify.

* adapt and run neurocognitive modeling notebook [no ci]

* adapt cCM playground notebook [no ci]

* adapt signature of Adapter.standardize

* add parameters missed in previous commit

* Minor NNPE polishing

* remove stage in docstring from OnlineDataset

---------

Co-authored-by: Lasse Elsemüller <60779710+elseml@users.noreply.github.com>
Co-authored-by: Valentin Pratz <git@valentinpratz.de>

* Fix training strategies in BasicWorkflow

* move multimodal data notebook to regular examples [no ci]

* make pip install call on homepage more verbose [no ci]

* remove deprecated summaries function

The function was renamed to summarize in v2.0.4.

* detail subsampling behavior docs for SIR simulator [no ci]

fixes bayesflow-org#518

* move DiffusionModel from experimental to networks

Stabilizes the DiffusionModel class. A deprecation warning for the
DiffusionModel class in the experimental module was added.

* Add citation for resnet (bayesflow-org#537) [no ci]

* added citation for resnet

* minor formatting

---------

Co-authored-by: Valentin Pratz <git@valentinpratz.de>

* Bump up version [skip ci]

* Allow separate inputs to subnets for continuous models (bayesflow-org#521)

Introduces easy access to the different inputs x, t and conditions, to allow for specialized processing of each input, which can be beneficial for more advanced use cases.

---------

Co-authored-by: Valentin Pratz <git@valentinpratz.de>

* Auto-select backend (bayesflow-org#543)

* add automatic backend detection and selection

* Fix typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add priority ordering of backends

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>

* Breaking: parameterize MVNormalScore by inverse cholesky factor to improve stability (bayesflow-org#545)

* breaking: parameterize MVNormalScore by inverse cholesky factor

The log_prob can be completely calculated using the inverse cholesky
factor L^{-1}. Using this also stabilizes the initial loss, and speeds
up computation.

This commit also contains two optimizations.
Moving the computation of the precision matrix into the einsum, and
using the sum of the logs instead of the log of a product.

As the parameterization changes, this is a breaking change.

* Add right_side_scale_inverse and test [no ci]

The transformation necessary to undo standardization for a Cholesky
factor of the precision matrix is x_ij = x_ij' / sigma_j, which is now
implemented by a right_side_scale_inverse transformation_type.

* Stop skipping MVN tests

* Remove stray keyword argument in fill_triangular_matrix

* Rename cov_chol_inv to precision_chol and update docstrings [no ci]

* rename precision_chol to precision_cholesky_factor

to improve clarity.

* rename cov_chol to covariance_cholesky_factor

* remove check_approximator_multivariate_normal_score function [no ci]

---------

Co-authored-by: han-ol <g@hans.olischlaeger.com>

* fix unconditional sampling in ContinuousApproximator (bayesflow-org#548)

- batch shape was calculated from inference_conditions even if they are
  known to be None
- add approximator test for unconditional setting

* Test quantities Linear Regression Starter notebook (bayesflow-org#544)

* Implementation of log-lik test quantity for SBC in starter notebook

* update data-dependent test-quantities example

* Small typo fixes in linear regression notebook

---------

Co-authored-by: Paul-Christian Bürkner <paul.buerkner@gmail.com>

* fix: optimizer was not used in workflow with multiple fits

For the optimizer to be used, the approximator.compile function has to
be called. This was not the case. I adapted the `setup_optimizer`
function to match the description in its docstring, and made the
compilation conditional on its output. The output indicates if a new
optimizer was configured.

* fix: remove extra deserialize call for SummaryNetwork

The extra call leads to the DTypePolicy to be deserialized. This is then
passed as a class, and cannot be handled by autoconf, leading to the
error discussed in
bayesflow-org#549

* Compatibility: deserialize when get_config was overridden

* unify log_prob signature in PointApproximator [no ci]

ContinuousApproximator and BasicWorkflow allow passing the data
positionally, we can allow the same for the PointApproximator.

* Tutorial on spatial data with Gaussian Random Fields (bayesflow-org#540) [no ci]

The tutorial uses the experimental ResNet class to build a summary
network for spatial data.

* Support non-array data in test_quantity calibration ecdf [no ci]

Simulator outputs are allowed to be of type int or float, and
consequently have no batch dimension. This needs to be considered
in the broadcasting of inference_conditions for data based SBC
test quantities.

"examples/Linear_Regression_Starter.ipynb" contains an example where this is
necessary, where N is a non-batchable integer.

* import calibration_log_gamma in diagnostics namespace [no ci]

* Add wrapper around scipy.integrate.solve_ivp for integration

* minor fixes and improvements to the pairs plot functions

- pass target color to legend
- do not use common norm, so that prior stays visible in kdeplots
- do not share y on the diagonal, so that all marginal distributions
  stay visible, even if one is very peaked

* fix: layers were not deserialized for Sequential and Residual

As layers were passed with the `*layers` syntax, they could not be
passed as keyword arguments. In `from_config`, however, this was
attempted, leading to the layers to be ignored during reserialization.
This commit fixes this by taking the layers from `kwargs` if they are
passed as a keyword argument.

* add serialization tests for Sequential and Residual

* Fix: ensure checkpoint filepath exists before training

Previously choosing a non-existant directory as checkpoint_filepath
would lead to silently not saving at all.

* Revert 954c16c since it was unnecessary

The alledged issue didn't exist and checkpoint folders are created by
the keras callback automatically already.

I misread tests on this and didn't catch that the problem I was seeing
was caused by a different part of my pipeline.

* improvements to diagnostic plots (bayesflow-org#556)

* improvements to diagnostics plots

add markersize parameter, add tests, support dataset_id for
pairs_samples

Fixes bayesflow-org#554.

* simplify test_calibration_ecdf_from_quantiles

* Add pairs plot for arbitrary quantities (bayesflow-org#550)

Add pairs_quantity and plot_quantity functions that allow plotting of quantities that can be calculated for each individual dataset. Currently, for the provided metrics this is only useful for posterior contraction, but could be useful for posterior z-score and other quantities as well.

* minor fix in diffusion edm schedule (bayesflow-org#560)

* minor fix in diffusion edm schedule

* DeepSet: Adapt output dimension of invariant module inside the equivariant module (bayesflow-org#557) (bayesflow-org#561)

* adapt output dim of invariant module in equivariant module

See bayesflow-org#557. The DeepSet showed bad performance and was not able to learn
diverse summary statistics. Reducing the dimension of the output of the
invariant module inside the equivariant module improves this, probably
because the invidividual information of each set member gains importance
compared to the shared information provided by the invariant module.

There might be better settings for this, so we might update the default
later on. However, this is already an improvement over the previous
setting.

* DeepSet: adapt docstring to reflect code

* pairs_postorior: inconsistent type hint fix (bayesflow-org#562)

* allow exploding variance type in EDM schedule

* fix type hint

* Bump up version [skip ci]

* Fix instructions for backend spec [skip ci]

* Add New Flow Matching Schedules (bayesflow-org#565)

* add fm schedule

* add fm schedule

* add comments

* expose time_power_law_alpha

* Improve doc [skip ci]

---------

Co-authored-by: stefanradev93 <stefan.radev93@gmail.com>

* change default integration method to rk45

for DiffusionModel and FlowMatching. Euler shows significant deviations
when computing the log-prob, which risks misleading users regarding the
performance of the networks.

rk45 is slower, but the problem is heavily reduced with this method.

* fix nan to num inverse

* fix setting markersize in lotka volterra notebook

* fix: actually set KERAS_BACKEND to chosen backend

Add warning if KERAS_BACKEND and actually loaded backend do not match.
This can happen if keras is imported before BayesFlow.

* Fix warning msg

---------

Co-authored-by: Valentin Pratz <112951103+vpratz@users.noreply.github.com>
Co-authored-by: han-ol <g@hans.olischlaeger.com>
Co-authored-by: Daniel Habermann <133031176+daniel-habermann@users.noreply.github.com>
Co-authored-by: Valentin Pratz <git@valentinpratz.de>
Co-authored-by: arrjon <jonas.arruda@uni-bonn.de>
Co-authored-by: Lars <lars@kuehmichel.de>
Co-authored-by: Hans Olischläger <106988117+han-ol@users.noreply.github.com>
Co-authored-by: Lasse Elsemüller <60779710+elseml@users.noreply.github.com>
Co-authored-by: Leona Odole <88601208+eodole@users.noreply.github.com>
Co-authored-by: Jonas Arruda <69197639+arrjon@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Paul-Christian Bürkner <paul.buerkner@gmail.com>
Co-authored-by: The-Gia Leo Nguyen <Leo.Nguyen@gmx.de>
Added a test to validate saving and loading for all standardize variants of the ContinuousApproximator.
@stefanradev93
Copy link
Contributor

Hi Sermet, thanks for the first contribution! Can you provide some insight into the failure, as I am unable to reproduce it on my windows machine and do not have any intuition about why the fix works. The error msg is:

- ValueError: For a build()method with more than one argument, all arguments should have a_shape suffix, but both input_shape and input_set_shape have the required suffix.

@LarsKue
Copy link
Contributor

LarsKue commented Oct 27, 2025

Could be a new upstream issue. @stefanradev93 which version of keras did you test this on? The windows workflow did not catch this issue, but it has been a while since it ran on main.

The current code does not seem faulty, since the build method only has one argument, unlike what the error message describes. So both input_shape and input_set_shape argument names should be valid, regardless of their suffix.

@stefanradev93
Copy link
Contributor

I am on 3.10.0.

@LarsKue
Copy link
Contributor

LarsKue commented Oct 27, 2025

@SermetPekin is on 3.11.3, so this could be it. I will investigate and report back shortly.

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
bayesflow/networks/deep_set/equivariant_layer.py 100.00% <100.00%> (ø)
bayesflow/networks/deep_set/invariant_layer.py 100.00% <100.00%> (ø)

@SermetPekin
Copy link
Author

Hi Sermet, thanks for the first contribution! Can you provide some insight into the failure, as I am unable to reproduce it on my windows machine and do not have any intuition about why the fix works. The error msg is:

- ValueError: For a build()method with more than one argument, all arguments should have a_shape suffix, but both input_shape and input_set_shape have the required suffix.

Thanks for the review @stefanradev93 .
I think the reason looks like keras at some point decided to force specific name format of these classes [ for methods call and build ] if it is x for call it should be x_shape for the other. it is just internal name change which would not make anything worse for backward compad (as long as those functions are passing positional ) I will test with 3.10.0 now.

@LarsKue
Copy link
Contributor

LarsKue commented Oct 27, 2025

@SermetPekin your assumption is close, but not quite true (unless they changed it recently). If my memory serves right, Keras assumes the following signature for the build and call methods:

def build(self, build_arg):
    ...

def call(self, call_arg):
    ...

where build_arg and call_arg can both be named anything. build_arg is then passed the value of keras.ops.shape(call_arg). However, this is incompatible with methods that have multiple call_args:

def call(self, x, y):
    # e.g. a Transformer
    ...

Their solution is to then require that the build method specifies in its signature which shape arguments it needs. For the example above, this then becomes

def build(self, x_shape, y_shape):
    ...

where the naming of the arguments is now fixed.

In our case, this should not be a problem, since we only have one forward argument Tensor.

@SermetPekin
Copy link
Author

SermetPekin commented Oct 27, 2025

is it possible that it is due to we have 2 _ in input_set_shape ? (just brain storming )
When I search in keras code this is throwing it
keras

# keras 3.10.0 + tensorflow 2.20.0 

pytest -v tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load 

FAILED tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load[standardize='all'] - ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.
FAILED tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load[standardize=None] - ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.
FAILED tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load[standardize='inference_variables'] - ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.
FAILED tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load[standardize='summary_variables'] - ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.
FAILED tests/test_approximators/test_approximator_standardization/test_approximator_standardization.py::test_save_and_load[standardize=('inference_variables', 'summary_variables', 'inference_conditions')] - ValueError: For a `build()` method with more than one argument, all arguments should have a `_shape` suffix and match an argument from `call()`. E.g. `build(self, foo_shape, bar_shape)`  For layer 'EquivariantLayer', Received `build()` argument `self`, which does not end in `_shape`.


@LarsKue
Copy link
Contributor

LarsKue commented Oct 27, 2025

In other news, I re-ran the workflow and could not reproduce the issue, even with version 3.11.3, so marking this as not reproducible for now. Below, you may find the package versions that I tested this with, so if you keep encountering the issue and can reliably reproduce it, please re-open this PR:

Windows + JAX
Package                   Version
------------------------- -----------
absl-py                   2.3.1
asttokens                 3.0.0
attrs                     25.4.0
bayesflow                 2.0.7
beautifulsoup4            4.14.2
bleach                    6.2.0
colorama                  0.4.6
comm                      0.2.3
contourpy                 1.3.2
coverage                  7.11.0
cycler                    0.12.1
debugpy                   1.8.17
decorator                 5.2.1
defusedxml                0.7.1
exceptiongroup            1.3.0
execnet                   2.1.1
executing                 2.2.1
fastjsonschema            2.21.2
fonttools                 4.60.1
h5py                      3.15.1
iniconfig                 2.3.0
ipykernel                 7.1.0
ipython                   8.37.0
jax                       0.6.2
jaxlib                    0.6.2
jedi                      0.19.2
Jinja2                    3.1.6
jsonschema                4.25.1
jsonschema-specifications 2025.9.1
jupyter_client            8.6.3
jupyter_core              5.9.1
jupyterlab_pygments       0.3.0
keras                     3.11.3
kiwisolver                1.4.9
markdown-it-py            4.0.0
MarkupSafe                3.0.3
matplotlib                3.10.7
matplotlib-inline         0.2.1
mdurl                     0.1.2
mistune                   3.1.4
ml_dtypes                 0.5.3
namex                     0.1.0
nbclient                  0.10.2
nbconvert                 7.16.6
nbformat                  5.10.4
nest-asyncio              1.6.0
numpy                     1.26.4
opt_einsum                3.4.0
optree                    0.17.0
packaging                 25.0
pandas                    2.3.3
pandocfilters             1.5.1
parso                     0.8.5
pillow                    12.0.0
pip                       25.3
platformdirs              4.5.0
pluggy                    1.6.0
prompt_toolkit            3.0.52
psutil                    7.1.2
pure_eval                 0.2.3
Pygments                  2.19.2
pyparsing                 3.2.5
pytest                    8.4.2
pytest-cov                7.0.0
pytest-rerunfailures      16.1
pytest-xdist              3.8.0
python-dateutil           2.9.0.post0
pytz                      2025.2
pyzmq                     27.1.0
referencing               0.37.0
rich                      14.2.0
rpds-py                   0.28.0
scipy                     1.15.3
seaborn                   0.13.2
setuptools                80.9.0
six                       1.17.0
soupsieve                 2.8
stack-data                0.6.3
tinycss2                  1.4.0
tomli                     2.3.0
tornado                   6.5.2
tqdm                      4.67.1
traitlets                 5.14.3
typing_extensions         4.15.0
tzdata                    2025.2
wcwidth                   0.2.14
webencodings              0.5.1
wheel                     0.45.1
Windows + TensorFlow
Package                   Version
------------------------- -----------
absl-py                   2.3.1
asttokens                 3.0.0
astunparse                1.6.3
attrs                     25.4.0
bayesflow                 2.0.7
beautifulsoup4            4.14.2
bleach                    6.2.0
certifi                   2025.10.5
charset-normalizer        3.4.4
colorama                  0.4.6
comm                      0.2.3
contourpy                 1.3.2
coverage                  7.11.0
cycler                    0.12.1
debugpy                   1.8.17
decorator                 5.2.1
defusedxml                0.7.1
exceptiongroup            1.3.0
execnet                   2.1.1
executing                 2.2.1
fastjsonschema            2.21.2
flatbuffers               25.9.23
fonttools                 4.60.1
gast                      0.6.0
google-pasta              0.2.0
grpcio                    1.76.0
h5py                      3.15.1
idna                      3.11
iniconfig                 2.3.0
ipykernel                 7.1.0
ipython                   8.37.0
jedi                      0.19.2
Jinja2                    3.1.6
jsonschema                4.25.1
jsonschema-specifications 2025.9.1
jupyter_client            8.6.3
jupyter_core              5.9.1
jupyterlab_pygments       0.3.0
keras                     3.11.3
kiwisolver                1.4.9
libclang                  18.1.1
Markdown                  3.9
markdown-it-py            4.0.0
MarkupSafe                3.0.3
matplotlib                3.10.7
matplotlib-inline         0.2.1
mdurl                     0.1.2
mistune                   3.1.4
ml_dtypes                 0.5.3
namex                     0.1.0
nbclient                  0.10.2
nbconvert                 7.16.6
nbformat                  5.10.4
nest-asyncio              1.6.0
numpy                     1.26.4
opt_einsum                3.4.0
optree                    0.17.0
packaging                 25.0
pandas                    2.3.3
pandocfilters             1.5.1
parso                     0.8.5
pillow                    12.0.0
pip                       25.3
platformdirs              4.5.0
pluggy                    1.6.0
prompt_toolkit            3.0.52
protobuf                  6.33.0
psutil                    7.1.2
pure_eval                 0.2.3
Pygments                  2.19.2
pyparsing                 3.2.5
pytest                    8.4.2
pytest-cov                7.0.0
pytest-rerunfailures      16.1
pytest-xdist              3.8.0
python-dateutil           2.9.0.post0
pytz                      2025.2
pyzmq                     27.1.0
referencing               0.37.0
requests                  2.32.5
rich                      14.2.0
rpds-py                   0.28.0
scipy                     1.15.3
seaborn                   0.13.2
setuptools                80.9.0
six                       1.17.0
soupsieve                 2.8
stack-data                0.6.3
tensorboard               2.20.0
tensorboard-data-server   0.7.2
tensorflow                2.20.0
termcolor                 3.2.0
tinycss2                  1.4.0
tomli                     2.3.0
tornado                   6.5.2
tqdm                      4.67.1
traitlets                 5.14.3
typing_extensions         4.15.0
tzdata                    2025.2
urllib3                   2.5.0
wcwidth                   0.2.14
webencodings              0.5.1
Werkzeug                  3.1.3
wheel                     0.45.1
wrapt                     2.0.0
Windows + PyTorch
Package                   Version
------------------------- -----------
absl-py                   2.3.1
asttokens                 3.0.0
attrs                     25.4.0
bayesflow                 2.0.7
beautifulsoup4            4.14.2
bleach                    6.2.0
colorama                  0.4.6
comm                      0.2.3
contourpy                 1.3.2
coverage                  7.11.0
cycler                    0.12.1
debugpy                   1.8.17
decorator                 5.2.1
defusedxml                0.7.1
exceptiongroup            1.3.0
execnet                   2.1.1
executing                 2.2.1
fastjsonschema            2.21.2
filelock                  3.19.1
fonttools                 4.60.1
fsspec                    2025.9.0
h5py                      3.15.1
iniconfig                 2.3.0
ipykernel                 7.1.0
ipython                   8.37.0
jedi                      0.19.2
Jinja2                    3.1.6
jsonschema                4.25.1
jsonschema-specifications 2025.9.1
jupyter_client            8.6.3
jupyter_core              5.9.1
jupyterlab_pygments       0.3.0
keras                     3.11.3
kiwisolver                1.4.9
markdown-it-py            4.0.0
MarkupSafe                3.0.3
matplotlib                3.10.7
matplotlib-inline         0.2.1
mdurl                     0.1.2
mistune                   3.1.4
ml_dtypes                 0.5.3
mpmath                    1.3.0
namex                     0.1.0
nbclient                  0.10.2
nbconvert                 7.16.6
nbformat                  5.10.4
nest-asyncio              1.6.0
networkx                  3.3
numpy                     1.26.4
optree                    0.17.0
packaging                 25.0
pandas                    2.3.3
pandocfilters             1.5.1
parso                     0.8.5
pillow                    12.0.0
pip                       25.3
platformdirs              4.5.0
pluggy                    1.6.0
prompt_toolkit            3.0.52
psutil                    7.1.2
pure_eval                 0.2.3
Pygments                  2.19.2
pyparsing                 3.2.5
pytest                    8.4.2
pytest-cov                7.0.0
pytest-rerunfailures      16.1
pytest-xdist              3.8.0
python-dateutil           2.9.0.post0
pytz                      2025.2
pyzmq                     27.1.0
referencing               0.37.0
rich                      14.2.0
rpds-py                   0.28.0
scipy                     1.15.3
seaborn                   0.13.2
setuptools                80.9.0
six                       1.17.0
soupsieve                 2.8
stack-data                0.6.3
sympy                     1.14.0
tinycss2                  1.4.0
tomli                     2.3.0
torch                     2.9.0+cpu
torchaudio                2.9.0+cpu
torchvision               0.24.0+cpu
tornado                   6.5.2
tqdm                      4.67.1
traitlets                 5.14.3
typing_extensions         4.15.0
tzdata                    2025.2
wcwidth                   0.2.14
webencodings              0.5.1
wheel                     0.45.1

@LarsKue
Copy link
Contributor

LarsKue commented Oct 27, 2025

@SermetPekin I don't think it is likely, but feel free to try using inputset and inputset_shape instead.

@SermetPekin
Copy link
Author

can it be due to sanitize_input_shape decorator on top of build ?

@SermetPekin
Copy link
Author

@LarsKue , @stefanradev93 I will check this issue and come back with a detailed report soon. Thanks for your valuable feedback and your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants