BayesFlow incompatible with keras==3.13.1

Hey BF Team,

I am a first time user of BF and I followed the install section on the readme and tried to run the first example but it failed with a Keras error:

python3.11/site-packages/keras/src/layers/core/dense.py", line 101, in _init_

**raise ValueError(**

ValueError: Received an invalid value for `units`, expected a positive integer. Received: units=None

Workaround: I uninstalled the default keras 3.13.1 (installed with pip install bayesflow) and replaced it with 3.10.0.

I am not sure the best fix but the issue is not mentioned on the bayesflow readme maybe update the requirements keras<3.13?

Let me know if I can help.

Thanks!

Nick

Hi Nick,

Welcome to our forums! Yes, upstream keras created a few incompatibilities. This issue will be solved in the upcoming 2.0.8 version which will be merged this week: Version 2.0.8 by stefanradev93 · Pull Request #615 · bayesflow-org/bayesflow · GitHub

For now, can you please install from dev and let me know if the issue persists?

pip install git+https://github.com/bayesflow-org/bayesflow.git@dev

The new release was published yesterday. Let us know if there are any problems!