Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The following Variables were created within a Lambda layer (yolo_loss) error #8

Open
Medicmind opened this issue Jan 19, 2022 · 1 comment

Comments

@Medicmind
Copy link

I have installed everything as per requirements.txt but when I run

python train.py

I get the following error message:

Traceback (most recent call last):
  File "train.py", line 38, in <module>
    model_loss = keras.layers.Lambda(function=loss.yolo4_loss, output_shape=(1,), name='yolo_loss')([*model_yolo.output, *y_true])
  File "/home/skinhat/tf2-yolov4-online/tensorflow/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 922, in __call__
    outputs = call_fn(cast_inputs, *args, **kwargs)
  File "/home/skinhat/tf2-yolov4-online/tensorflow/lib/python3.8/site-packages/tensorflow/python/keras/layers/core.py", line 889, in call
    self._check_variables(created_variables, tape.watched_variables())
  File "/home/skinhat/tf2-yolov4-online/tensorflow/lib/python3.8/site-packages/tensorflow/python/keras/layers/core.py", line 916, in _check_variables
    raise ValueError(error_str)
ValueError: 
The following Variables were created within a Lambda layer (yolo_loss)
but are not tracked by said layer:
  <tf.Variable 'yolo_loss/conv2d/kernel:0' shape=(3, 3, 3, 32) dtype=float32>
  <tf.Variable 'yolo_loss/batch_normalization/gamma:0' shape=(32,) dtype=float32>
  <tf.Variable 'yolo_loss/batch_normalization/beta:0' shape=(32,) dtype=float32>
  <tf.Variable 'yolo_loss/batch_normalization/moving_mean:0' shape=(32,) dtype=float32>
  <tf.Variable 'yolo_loss/batch_normalization/moving_variance:0' shape=(32,) dtype=float32>
@Ohou-csu
Copy link

Ohou-csu commented Jan 19, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants