And this gets me an error, I have not found any same issue over Internet:
Traceback (most recent call last):
File "test.py", line 195, in <module>
agent.restore(checkpoint_path)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/tune/trainable.py", line 467, in restore
self.load_checkpoint(checkpoint_path)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/agents/trainer.py", line 1823, in load_checkpoint
self.__setstate__(extra_data)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/agents/trainer.py", line 2443, in __setstate__
self.workers.local_worker().restore(state["worker"])
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/evaluation/rollout_worker.py", line 1346, in restore
self.policy_map[pid].set_state(state)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/policy/torch_policy.py", line 722, in set_state
super().set_state(state)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/policy/policy.py", line 638, in set_state
self.set_weights(state["weights"])
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/ray/rllib/policy/torch_policy.py", line 675, in set_weights
self.model.load_state_dict(weights)
File "/Users/fridary/miniforge3/envs/rl/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ComplexInputNetwork:
size mismatch for post_fc_stack._value_branch._model.0.weight: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([1, 256]).
size mismatch for logits_layer._model.0.weight: copying a param with shape torch.Size([2, 32]) from checkpoint, the shape in current model is torch.Size([2, 256]).
size mismatch for value_layer._model.0.weight: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([1, 256]).
Any ideas what's wrong? If I change "framework" to "tf", there are no errors.
I pasted code "Train and Evaluate using Ray" https://www.tensortrade.org/en/latest/examples/train_and_evaluate_using_ray.html, tuning works good. After this I added code from "Using Ray with TensorTrade" https://www.tensortrade.org/en/latest/tutorials/ray.html to restore checkpoints:
And this gets me an error, I have not found any same issue over Internet:
Any ideas what's wrong? If I change
"framework"
to"tf"
, there are no errors.