semitable / seac

The official code base of Shared Experience Actor-Critic (NeurIPS2020)
19 stars 23 forks source link

Error when running `evaluate.py` #7

Open aryu99 opened 1 year ago

aryu99 commented 1 year ago

I am getting the following error when running evaluate.py. Was the environment configuration altered after training?

Observation space: 4 Action space: Tuple(Discrete(5), Discrete(5), Discrete(5), Discrete(5)) /home/aryaman/.local/lib/python3.8/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/aryaman/.local/lib/python3.8/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/aryaman/.local/lib/python3.8/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) Traceback (most recent call last): File "evaluate.py", line 32, in agent.restore(path + f"/agent{agent.agent_id}") File "/home/aryaman/Hierarchical_Compositional_rl/baselines/seac/seac/a2c.py", line 89, in restore v.load_state_dict(checkpoint[k].state_dict()) File "/home/aryaman/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1223, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Policy: size mismatch for base.actor.0.weight: copying a param with shape torch.Size([64, 71]) from checkpoint, the shape in current model is torch.Size([64, 91]). size mismatch for base.critic.0.weight: copying a param with shape torch.Size([64, 71]) from checkpoint, the shape in current model is torch.Size([64, 91]).