Fehler beim Ausführen von zfit unter Ubuntu 22.04 mit Python 3.10.12 und TensorFlow 2.18.0Python

Python-Programme
Guest
 Fehler beim Ausführen von zfit unter Ubuntu 22.04 mit Python 3.10.12 und TensorFlow 2.18.0

Post by Guest »

Ich versuche, zfit auf meinem Ubuntu 22.04-Laptop auszuführen. Ich habe es so installiert:

Code: Select all

python -m venv venv
source venv/bin/activate
pip install zfit
Ich habe diesen Code ausgeführt (von https://github.com/zfit/zfit):

Code: Select all

import zfit
import numpy as np

obs = zfit.Space('x', -10, 10)

# create the model
mu    = zfit.Parameter("mu"   , 2.4, -1, 5)
sigma = zfit.Parameter("sigma", 1.3,  0, 5)
gauss = zfit.pdf.Gauss(obs=obs, mu=mu, sigma=sigma)

# load the data
data_np = np.random.normal(size=10000)
data = zfit.Data(obs=obs, data=data_np)
# or sample from model
data = gauss.sample()
und ich habe diesen Fehler:

Code: Select all

Traceback (most recent call last):
File "/home/pleskot/ftft/test.py", line 15, in 
data = gauss.sample()
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/zfit/core/basemodel.py", line 1196, in sample
tensor = run_tf(n=n, limits=limits, x=xclean)
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/zfit/core/basemodel.py", line 1192, in run_tf
return self._single_hook_sample(n=n, limits=limits, x=x)  # todo: make data a composite object
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/zfit/z/zextension.py", line 332, in concrete_func
result = func_to_run(*args, **kwargs)
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/zfit/core/basemodel.py", line 1202, in _single_hook_sample
return self._hook_sample(n=n, limits=limits)
File "/home/pleskot/ftft/venv/lib/python3.10/site-packages/zfit/core/basepdf.py", line 785, in _hook_sample
raise tf.errors.InvalidArgumentError(msg)
TypeError: InvalidArgumentError.__init__() missing 2 required positional arguments: 'op' and 'message'
Ich habe das Gleiche mit Python 3.11 auf demselben System erlebt.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post