Skip to content

Update tensorflow-probability requirement from <0.20.0,>=0.8.0 to >=0.8.0,<0.21.0#785

Closed
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/tensorflow-probability-gte-0.8.0-and-lt-0.21.0
Closed

Update tensorflow-probability requirement from <0.20.0,>=0.8.0 to >=0.8.0,<0.21.0#785
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/tensorflow-probability-gte-0.8.0-and-lt-0.21.0

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 9, 2023

Updates the requirements on tensorflow-probability to permit the latest version.

Release notes

Sourced from tensorflow-probability's releases.

TensorFlow Probability 0.20.0

Release notes

This is the 0.20.0 release of TensorFlow Probability. It is tested and stable against TensorFlow version 2.12 and JAX 0.4.8 .

Change notes

[Coming soon.]

Huge thanks to all the contributors to this release!

[Coming soon.]

Commits
  • e81e7e8 Update version and TF version requirement for TFP 0.20.0 release.
  • 14c180b Update inspect.getargspec (deleted in Python 3.11) to .getfullargspec.
  • 04a895d Remove pinned keras-nightly dependency.
  • 3bc2c32 Revert "Redirect all references away from targets to be deleted onto the new ...
  • 80ea3c1 Revert "Refactor case and case_v2 out of control_flow_ops.py."
  • 774c6a4 Add SymmetricMatrixSpace and ConstantDiagonalSymmetricMatrixSpace.
  • abc165a Add tests for Parallel acquisition functions when using transform_fn.
  • 20b3d85 Re-enable tests after fixes to graph dismantling.
  • 9bc0d1e Have low_rank_cholesky return the diagonal of the residual, as it is useful
  • 04c1006 Redirect all references away from targets to be deleted onto the new location...
  • Additional commits viewable in compare view

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Updates the requirements on [tensorflow-probability](https://github.com/tensorflow/probability) to permit the latest version.
- [Release notes](https://github.com/tensorflow/probability/releases)
- [Commits](tensorflow/probability@0.8.0...v0.20.0)

---
updated-dependencies:
- dependency-name: tensorflow-probability
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label May 9, 2023
@dependabot dependabot bot requested review from ascillitoe, jklaise and mauicv May 9, 2023 07:57
@ascillitoe
Copy link
Contributor

Blocked because following occurs on Python 3.7:

ImportError: This version of TensorFlow Probability requires TensorFlow version >= 2.12; Detected an installation of version 2.11.0. Please upgrade TensorFlow to proceed.

tensorflow>=2.12 isn't compatible with 3.7. Probably easiest to leave this until we deprecate 3.7...

@ascillitoe ascillitoe added the Blocked Issue is blocked by some bigger issue label May 9, 2023
@jklaise
Copy link
Contributor

jklaise commented May 23, 2023

FYI this will also require updates to the models.tensorflow.losses subpackage as evidenced by trying to run od_vae_cifar10.ipynb. Fix should be fairly simple according to this: tensorflow/probability#1677

Stack-trace of error:

2023-05-23 10:09:49.031457: W tensorflow/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 614400000 exceeds 10% of free system memory.
2023-05-23 10:09:49.132659: W tensorflow/tsl/framework/cpu_allocator_impl.cc:83] Allocation of 614400000 exceeds 10% of free system memory.
2023-05-23 10:09:49.408856: I tensorflow/core/common_runtime/executor.cc:1197] [/device:CPU:0] (DEBUG INFO) Executor start aborting (this does not indicate an error and you can ignore this message): INVALID_ARGUMENT: You must feed a value for placeholder tensor 'Placeholder/_0' with dtype float and shape [50000,32,32,3]
	 [[{{node Placeholder/_0}}]]
2023-05-23 10:09:49.409059: I tensorflow/core/common_runtime/executor.cc:1197] [/device:CPU:0] (DEBUG INFO) Executor start aborting (this does not indicate an error and you can ignore this message): INVALID_ARGUMENT: You must feed a value for placeholder tensor 'Placeholder/_0' with dtype float and shape [50000,32,32,3]
	 [[{{node Placeholder/_0}}]]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 37
     30 od = OutlierVAE(threshold=.015,  # threshold for outlier score
     31                 score_type='mse',  # use MSE of reconstruction error for outlier detection
     32                 encoder_net=encoder_net,  # can also pass VAE model instead
     33                 decoder_net=decoder_net,  # of separate encoder and decoder
     34                 latent_dim=latent_dim,
     35                 samples=2)
     36 # train
---> 37 od.fit(X_train, 
     38        loss_fn=elbo,
     39        cov_elbo=dict(sim=.05),
     40        epochs=50,
     41        verbose=False)
     43 # save the trained outlier detector
     44 save_detector(od, filepath)

File ~/PycharmProjects/alibi-detect/alibi_detect/od/vae.py:136, in OutlierVAE.fit(self, X, loss_fn, optimizer, cov_elbo, epochs, batch_size, verbose, log_metric, callbacks)
    133     kwargs['loss_fn_kwargs'] = {cov_elbo_type: tf.dtypes.cast(cov, tf.float32)}
    135 # train
--> 136 trainer(*args, **kwargs)

File ~/PycharmProjects/alibi-detect/alibi_detect/models/tensorflow/trainer.py:87, in trainer(model, loss_fn, x_train, y_train, dataset, optimizer, loss_fn_kwargs, preprocess_fn, epochs, reg_loss_fn, batch_size, buffer_size, verbose, log_metric, callbacks)
     85 if isinstance(loss_fn, Callable):  # type: ignore
     86     args = [y, y_hat] if tf.is_tensor(y_hat) else [y] + list(y_hat)
---> 87     loss = loss_fn(*args)
     88 else:
     89     loss = 0.

File ~/PycharmProjects/alibi-detect/alibi_detect/models/tensorflow/losses.py:41, in elbo(y_true, y_pred, cov_full, cov_diag, sim)
     38     y_mn = tfp.distributions.MultivariateNormalFullCovariance(Flatten()(y_pred),
     39                                                               covariance_matrix=cov_full)
     40 else:
---> 41     y_mn = tfp.distributions.MultivariateNormalDiag(Flatten()(y_pred),
     42                                                     scale_diag=cov_diag,
     43                                                     scale_identity_multiplier=sim)
     44 loss = -tf.reduce_mean(y_mn.log_prob(Flatten()(y_true)))
     45 return loss

File ~/.conda/envs/py310/lib/python3.10/site-packages/decorator.py:231, in decorate.<locals>.fun(*args, **kw)
    229 def fun(*args, **kw):
    230     if not kwsyntax:
--> 231         args, kw = fix(args, kw, sig)
    232     return caller(func, *(extras + args), **kw)

File ~/.conda/envs/py310/lib/python3.10/site-packages/decorator.py:203, in fix(args, kwargs, sig)
    199 def fix(args, kwargs, sig):
    200     """
    201     Fix args and kwargs to be consistent with the signature
    202     """
--> 203     ba = sig.bind(*args, **kwargs)
    204     ba.apply_defaults()  # needed for test_dan_schult
    205     return ba.args, ba.kwargs

File ~/.conda/envs/py310/lib/python3.10/inspect.py:3185, in Signature.bind(self, *args, **kwargs)
   3180 def bind(self, /, *args, **kwargs):
   3181     """Get a BoundArguments object, that maps the passed `args`
   3182     and `kwargs` to the function's signature.  Raises `TypeError`
   3183     if the passed arguments can not be bound.
   3184     """
-> 3185     return self._bind(args, kwargs)

File ~/.conda/envs/py310/lib/python3.10/inspect.py:3174, in Signature._bind(self, args, kwargs, partial)
   3172         arguments[kwargs_param.name] = kwargs
   3173     else:
-> 3174         raise TypeError(
   3175             'got an unexpected keyword argument {arg!r}'.format(
   3176                 arg=next(iter(kwargs))))
   3178 return self._bound_arguments_cls(self, arguments)

TypeError: got an unexpected keyword argument 'scale_identity_multiplier'

@ascillitoe
Copy link
Contributor

ascillitoe commented Jul 10, 2023

Blocked pending #828

@jklaise jklaise removed the Blocked Issue is blocked by some bigger issue label Jul 18, 2023
@jklaise
Copy link
Contributor

jklaise commented Jul 18, 2023

@dependabot rebase

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 18, 2023

Looks like tensorflow-probability is no longer updatable, so this is no longer needed.

@dependabot dependabot bot closed this Jul 18, 2023
@dependabot dependabot bot deleted the dependabot/pip/tensorflow-probability-gte-0.8.0-and-lt-0.21.0 branch July 18, 2023 09:18
@ascillitoe
Copy link
Contributor

Done in #828.

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

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error related to 'scale_identity_multiplier' in tensorflow

2 participants