experiencor / keras-yolo3

Training and Detecting Objects with YOLO3
MIT License
1.6k stars 861 forks source link

ValueError Exception on batch_seen variable #332

Open buckleytoby opened 2 years ago

buckleytoby commented 2 years ago

Getting this error when trying to train on my own dataset:

ValueError: Exception encountered when calling layer "yolo_layer_2" (type YoloLayer).

in user code:

    File "C:\Users\toby-\Documents\GitHub\keras-yolo3\yolo.py", line 47, in call  *
        batch_seen = tf.Variable(0.)

    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:
  • x=['tf.Tensor(shape=(None, None, None, 3), dtype=float32)', 'tf.Tensor(shape=(None, None, None, 231), dtype=float32)', 'tf.Tensor(shape=(None, None, None, 3, 77), dtype=float32)', 'tf.Tensor(shape=(None, 1, 1, 1, 28, 4), dtype=float32)']

Any ideas?

TanvirTaaha commented 2 years ago

Got the same error

Sneh09 commented 1 year ago

Getting same error. Did you solve the error ?