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
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[18], line 1
----> 1 compiled_model = nutpie.compile_pymc_model(obs_model)
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/nutpie/compile_pymc.py:170, in compile_pymc_model(model, **kwargs)
146 def compile_pymc_model(model: pm.Model, **kwargs) -> CompiledPyMCModel:
147 """Compile necessary functions for sampling a pymc model.
148
149 Parameters
(...)
158
159 """
161 (
162 n_dim,
163 n_expanded,
164 logp_fn_pt,
165 logp_fn,
166 expand_fn_pt,
167 expand_fn,
168 shared_expand,
169 shape_info,
--> 170 ) = _make_functions(model)
172 shared_data = {val.name: val.get_value().copy() for val in logp_fn_pt.get_shared()}
173 for val in shared_data.values():
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/nutpie/compile_pymc.py:248, in _make_functions(model)
247 def _make_functions(model):
--> 248 shapes = _compute_shapes(model)
250 # Make logp_dlogp_function
251 joined = pt.dvector("__joined_variables")
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/nutpie/compile_pymc.py:234, in _compute_shapes(model)
222 point = pm.model.make_initial_point_fn(model=model, return_transformed=True)(0)
224 trace_vars = {
225 var.name: var
226 for var in model.value_vars + model.free_RVs + model.deterministics
227 if var not in model.observed_RVs + model.potentials
228 }
230 shape_func = pytensor.compile.function.function(
231 inputs=[],
232 outputs=[var.shape for var in trace_vars.values()],
233 givens=(
--> 234 [(obs, obs.tag.observations) for obs in model.observed_RVs]
235 + [
236 (trace_vars[name], point[name])
237 for name in trace_vars.keys()
238 if name in point
239 ]
240 ),
241 mode=pytensor.compile.mode.FAST_COMPILE,
242 on_unused_input="ignore",
243 )
244 return {name: shape for name, shape in zip(trace_vars.keys(), shape_func())}
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/nutpie/compile_pymc.py:234, in <listcomp>(.0)
222 point = pm.model.make_initial_point_fn(model=model, return_transformed=True)(0)
224 trace_vars = {
225 var.name: var
226 for var in model.value_vars + model.free_RVs + model.deterministics
227 if var not in model.observed_RVs + model.potentials
228 }
230 shape_func = pytensor.compile.function.function(
231 inputs=[],
232 outputs=[var.shape for var in trace_vars.values()],
233 givens=(
--> 234 [(obs, obs.tag.observations) for obs in model.observed_RVs]
235 + [
236 (trace_vars[name], point[name])
237 for name in trace_vars.keys()
238 if name in point
239 ]
240 ),
241 mode=pytensor.compile.mode.FAST_COMPILE,
242 on_unused_input="ignore",
243 )
244 return {name: shape for name, shape in zip(trace_vars.keys(), shape_func())}
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/pymc/util.py:505, in _FutureWarningValidatingScratchpad.__getattribute__(self, name)
500 else:
501 warnings.warn(
502 f"The tag attribute {name} is deprecated. Use {alternative} instead",
503 FutureWarning,
504 )
--> 505 return super().__getattribute__(name)
File ~/.cache/pypoetry/virtualenvs/creativeab-fyBc7-Ny-py3.10/lib/python3.10/site-packages/pytensor/graph/utils.py:285, in Scratchpad.__getattribute__(self, name)
284 def __getattribute__(self, name):
--> 285 return super().__getattribute__(name)
AttributeError: '_FutureWarningValidatingScratchpad' object has no attribute 'observations'
The text was updated successfully, but these errors were encountered:
gives error
The text was updated successfully, but these errors were encountered: