FinRock icon indicating copy to clipboard operation
FinRock copied to clipboard

An Error in the code

Open mehran14 opened this issue 1 year ago • 1 comments

When I try to use the code to train the model, I faced the following problem:

FinRock-0.5.0\training_ppo_sinusoid_discrete.py", line 79, in agent = PPOAgent( ^^^^^^^^^ FinRock-0.5.0.conda\Lib\site-packages\rockrl\tensorflow\PPO\ppo.py", line 113, in init self.learning_rate = float(self.optimizer.lr.numpy()) ^^^^^^^^^^^^^^^^^ AttributeError: 'Adam' object has no attribute 'lr'

How can I fix this problem?

mehran14 avatar Dec 17 '24 14:12 mehran14

You need to change :

self.learning_rate = float(self.optimizer.lr.numpy())

by

self.learning_rate = float(self.optimizer.learning_rate.numpy())

It works for me, but I think there are more compatibility issues.

MatthieuQcc avatar Dec 20 '24 16:12 MatthieuQcc