lucidrains / q-transformer

Implementation of Q-Transformer, Scalable Offline Reinforcement Learning via Autoregressive Q-Functions, out of Google Deepmind
MIT License
333 stars 19 forks source link

Running the latest main branch with given usage example #10

Closed ramkumarkoppu closed 7 months ago

ramkumarkoppu commented 8 months ago

Running the latest main branch with given usage example, results in:

episode 0 99%|██████████████████████████████████████████████████████████████████████████▎| 99/100 [01:13<00:00, 1.35it/s] episode 1 0%| | 0/100 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/ram/github/q-transformer/example2.py", line 54, in agent() File "/home/ram/anaconda3/envs/q-transformer/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/home/ram/anaconda3/envs/q-transformer/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "/home/ram/anaconda3/envs/q-transformer/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "/home/ram/github/q-transformer/q_transformer/agent.py", line 255, in forward self.text_embeds[episode, step] = text_embed File "/home/ram/anaconda3/envs/q-transformer/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'Agent' object has no attribute 'text_embeds'

lucidrains commented 8 months ago

@ramkumarkoppu thanks for reporting; could you try in the latest version?