PixelCNN example from the documentation does not work
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- jupyter-notebook, python, tensorflow
- Domaine
- documentation, machine-learning
Piste de recherche
Commencez par l’exemple PixelCNN à l’URL de la documentation de l’API TensorFlow Probability et reproduisez-le dans Google Colab avec TensorFlow 2.19. Examinez l’échec au niveau de dist.log_prob(image_input) et suivez l’exception KerasTensor signalée. Le travail est terminé lorsque l’exemple documenté s’exécute correctement sans cette exception.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
How to repro?
TF version: 2.19.0
- Take an example from https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/PixelCNN#examples
- Create Google Colab
- Past the example into the Google Colab
- Run it
The following exception occurs:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[/tmp/ipython-input-624558695.py](https://localhost:8080/#) in <cell line: 0>()
33
34 # Define the log likelihood for the loss fn
---> 35 log_prob = dist.log_prob(image_input)
36
37 # Define the model
6 frames
<decorator-gen-128> in shape_v2(input, out_type, name)
[/usr/local/lib/python3.12/dist-packages/keras/src/backend/common/keras_tensor.py](https://localhost:8080/#) in __tf_tensor__(self, dtype, name)
154
155 def __tf_tensor__(self, dtype=None, name=None):
--> 156 raise ValueError(
157 "A KerasTensor cannot be used as input to a TensorFlow function. "
158 "A KerasTensor is a symbolic placeholder for a shape and dtype, "
ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces `keras.layers` and `keras.ops`). You are likely doing something like:
```
x = Input(...)
...
tf_fn(x) # Invalid.
```
What you should do instead is wrap `tf_fn` in a layer:
```
class MyLayer(Layer):
def call(self, x):
return tf_fn(x)
x = MyLayer()(x)
```
- Langage dominant
- Jupyter Notebook
- Étoiles
- 4.4k
- Forks
- 1.1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de tensorflow/probability
-
KL divergence between two `TransformedDistribution`s with a shared non-injective bijector (`AbsoluteValue`) returns the base KLPeut-être pris @Andreas-Hum l’a pris il y a 9 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
tensorflow/probability#2036 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 54/100
tensorflow/probability#2040 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
tensorflow/probability#2034 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
tensorflow/probability#2021 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
tensorflow/probability#2015 ·
Toutes les issues de tensorflow/probability
Issues similaires
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
NuSkooler/enigma-bbs#988 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
saschanaz/jxl-winthumb#69 ·
-
area:dev documentation U2-later
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
bentleypark/aiwatch#1957 ·
Les mainteneurs répondent en général sous 1 jour
-
backlog documentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 96/100
EchoTools/nevr-runtime#2354 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
Judgment-Pack/judgment-pack-spec#299 ·
Les mainteneurs répondent en général sous 1 jour