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

'DQNStrategy' object has no attribute 'clock' #20

Open
Ai360n opened this issue Aug 12, 2023 · 1 comment
Open

'DQNStrategy' object has no attribute 'clock' #20

Ai360n opened this issue Aug 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Ai360n
Copy link

Ai360n commented Aug 12, 2023

Hello,

I am writing to inform you that there is a problem between the avalanche-rl and DQNStrategy.
Unfortunately, in avalanche-rl when a strategy uses EWC plugin, below error will be raise:
Error for Compute EWC penalty and add it to the loss.
exp_counter = strategy.clock.train_exp_counter
if exp_counter == 0:
return
'DQNStrategy' object has no attribute 'clock'.

It needs to add 'clock' attribute in 'DQNStrategy'. I will appreciate if you update this bug in the avalanhe-rl.

avalanche-lib==0.3.1

@Ai360n Ai360n added the bug Something isn't working label Aug 12, 2023
@tobiapoppi
Copy link

tobiapoppi commented Aug 22, 2023

Hi @Ai360n, I'm having the same problem right now, but if you don't need the clock and you just need an alternative way to use the experience_counter, then just use the training_exp_counter attribute of the RLBaseStrategy class, which has the same meaning of train_exp_counter.

So inside ewc.py of avalanche just change your line to exp_counter = strategy.training_exp_counter (in both before_backward and after_training_exp methods).

Of course in order to do this you should have installed avalanche 0.3.1 locally with pip install -e . option, in order to use your local modifies as the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants