Closed AxelWimmer closed 1 year ago
The incompatibility of the new gym version causes such issues on the current examples provided in the documentation,
try downgrading the gym version using pip install gym==0.17.2
. Let me know if it works.
The major update v2.0.2
has been released. In this version, d3rlpy primary supports gym==2.6.0
. Probably, this won't be a problem anymore. Feel free to reopen this issue if there is any further discussion.
I installed d3rlpy via pip on Windows and tried to execute the basic example from the tutorial. For example:
However i always get the same error: Traceback (most recent call last): File "./online_rl.py", line 38, in
dqn.fit(train_episodes,
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\base.py", line 406, in fit
results = list(
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\base.py", line 665, in fitter
self._evaluate(eval_episodes, scorers, logger)
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\base.py", line 802, in _evaluate
test_score = scorer(self, episodes)
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\metrics\scorer.py", line 472, in scorer
action = algo.predict([observation])[0]
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\algos\base.py", line 127, in predict
return self._impl.predict_best_action(x)
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\torch_utility.py", line 305, in wrapper
return f(self, *args, **kwargs)
File "D:\MasterHiWi.hiwi_env\lib\site-packages\d3rlpy\torch_utility.py", line 246, in wrapper
tensor = tensor.to(self.device)
AttributeError: 'list' object has no attribute 'to'
The problem is caused by the different scorer metrics, but I don't understand why. It is supposed to work out of the box.