Skip to content

Instantly share code, notes, and snippets.

@yanboyang713
Created December 6, 2023 21:15
Show Gist options
  • Save yanboyang713/d104003f92b36ba216dbd991c803a6f2 to your computer and use it in GitHub Desktop.
Save yanboyang713/d104003f92b36ba216dbd991c803a6f2 to your computer and use it in GitHub Desktop.
WGAN.py
File "/home/yanboyang713/Documents/SyntheticOversampling/src/WGAN.py", line 48, in train_step *
fake_data = gen(noise, training=True)
File "/home/yanboyang713/Documents/SyntheticOversampling/test/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler **
raise e.with_traceback(filtered_tb) from None
File "/tmp/__autograph_generated_file6v04vxxq.py", line 10, in tf__call
x = ag__.converted_call(ag__.ld(self).input_layer, (ag__.ld(inputs),), None, fscope)
ValueError: Exception encountered when calling layer 'generator_1' (type Generator).
in user code:
File "/home/yanboyang713/Documents/SyntheticOversampling/src/WGAN.py", line 23, in call *
x = self.input_layer(inputs)
File "/home/yanboyang713/Documents/SyntheticOversampling/test/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler **
raise e.with_traceback(filtered_tb) from None
ValueError: tf.function only supports singleton tf.Variables created on the first call. Make sure the tf.Variable is only created once or created outside tf.function. See https://www.tensorflow.org/guide/function#creating_tfvariables for more information.
Call arguments received by layer 'generator_1' (type Generator):
• inputs=tf.Tensor(shape=(8, 10), dtype=float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment