profile
viewpoint

issue commenttensorflow/tensorflow

UnboundLocalError: local variable 'logs' referenced before assignment on training with little data

I have the same issue with TF v2.2.0-rc2

Epoch 19/20
18/18 [==============================] - 2s 125ms/step - loss: 0.0035 - accuracy: 1.0000
Epoch 20/20
18/18 [==============================] - 2s 126ms/step - loss: 0.0373 - accuracy: 0.9844

Traceback (most recent call last):
  File "run.py", line 155, in <module>
    main()
  File "run.py", line 120, in main
    accuracy, num_of_classes = train_Full_visible(unique_name)
  File "run.py", line 78, in train_Full_visible
    acc = neuro.train(picdb, train_ids, test_ids, "Full body visible")
  File "/ssd/200410 3rd Try/neuro.py", line 232, in train
    test_loss, test_acc = self.model.evaluate(test_generator, verbose=0)
  File "/home/frank/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 66, in _method_wrapper
    return method(self, *args, **kwargs)
  File "/home/frank/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1028, in evaluate
    logs = tf_utils.to_numpy_or_python_type(logs)
UnboundLocalError: local variable 'logs' referenced before assignment
naripok

comment created time in 3 months

more