I am currently training something and the code works well with Tensorflow==2.8.0
.
I want to use some functions in Tensorflow==2.13.1
, so I change the env and it raises the following errors:
My experimental platform: Ubuntu18.04, CUDA11.7, Tensorflow2.13.1
Detected at node 'learning_rate/Read/ReadVariableOp' defined at (most recent call last):
File "trainingXXX.py", line XXX, in <module>
train_XXX()
File "trainingXXX.py", line XXX, in train_XXX
model = model_XXX.get_model()
File "trainingXXX.py", line XXX, in model_XXX
return self.XXX_model()
File "/home/XXX/anaconda3/envs/XXX/lib/python3.8/site-packages/keras/src/optimizers/adam.py", line 120, in __init__
self._learning_rate = self._build_learning_rate(learning_rate)
File "/home/XXX/anaconda3/envs/XXX/lib/python3.8/site-packages/keras/src/optimizers/optimizer.py", line 1290, in _build_learning_rate
return super()._build_learning_rate(learning_rate)
File "/home/XXX/anaconda3/envs/XXX/lib/python3.8/site-packages/keras/src/optimizers/optimizer.py", line 395, in _build_learning_rate
return tf.Variable(
Node: 'learning_rate/Read/ReadVariableOp'
2 root error(s) found.
(0) FAILED_PRECONDITION: Could not find variable learning_rate. This could mean that the variable has been deleted. In TF1, it can also mean the variable is uninitialized. Debug info: container=localhost, status error message=Resource localhost/learning_rate/N10tensorflow3VarE does not exist.
[[{{node learning_rate/Read/ReadVariableOp}}]]
[[learning_rate/Read/ReadVariableOp/_259]]
(1) FAILED_PRECONDITION: Could not find variable learning_rate. This could mean that the variable has been deleted. In TF1, it can also mean the variable is uninitialized. Debug info: container=localhost, status error message=Resource localhost/learning_rate/N10tensorflow3VarE does not exist.
[[{{node learning_rate/Read/ReadVariableOp}}]]
0 successful operations.
0 derived errors ignored.
I have totally no idea why is this case. May someone offer me some advice? Thanks a lot.