Open acho98 opened 3 years ago
I tried to debug this, but all i found out is that the problem is in vae_loss
function, especially in z_log_var=z_log_var, z_mean
. Event tf.print(z_log_var)
causes TypeError: Could not build a TypeSpec for <tf.Operation 'tf.print/PrintV2' type=PrintV2> with type Operation
I've also encountered this problem. After checking several discussions on the internet, I use the add_loss() to assign the loss function instead of the loss parameter in compile().
it seems to work.
However, I still don't know the difference between the methods and why the original code can not work correctly.
The link is my test notebook https://colab.research.google.com/drive/1wbUljO1qKvuFeWx9rrl75gv58Is51wtB?usp=sharing
I've also encountered this problem. After checking several discussions on the internet, I use the add_loss() to assign the loss function instead of the loss parameter in compile().
it seems to work.
However, I still don't know the difference between the methods and why the original code can not work correctly.
The link is my test notebook https://colab.research.google.com/drive/1wbUljO1qKvuFeWx9rrl75gv58Is51wtB?usp=sharing Worked for me! Thanks
Just find the same issue. Still don't understand what cause the problem and how to solve it.
Really need some help!
Here are the error in details.
2021-05-10 11:34:20.296013: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 3799900000 Hz
Epoch 1/50
Traceback (most recent call last):
File "/home/zephyrus/Documents/Project/models/GAN/gans-in-action-master/chapter-2/c2.py", line 82, in
TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.
Process finished with exit code 1
Try this : tf version 2.1.0
vae.compile(optimizer='rmsprop', loss=vae_loss, experimental_run_tf_function = False)
#vae.compile(loss=None,optimizer='rmsprop')
vae.summary()
I've also encountered this problem. After checking several discussions on the internet, I use the add_loss() to assign the loss function instead of the loss parameter in compile().
it seems to work.
However, I still don't know the difference between the methods and why the original code can not work correctly.
The link is my test notebook https://colab.research.google.com/drive/1wbUljO1qKvuFeWx9rrl75gv58Is51wtB?usp=sharing
thank you! Without your comment , maybe I will drop this book !
the below errors occurred when i ran the Chapter_2_Autoencoder.ipynb my env is the colab
Epoch 1/50
TypeError Traceback (most recent call last)