Loading pickle file in Mac after writing in linux causing issues

Hi Ray community,

I am using rllib to save and load checkpoints. I am using the same version across Mac and Linux. I want to be able train on linux and infer on my Mac but I am getting the following error:

Traceback (most recent call last):
  File "/Users/psr/GitLab/psr.ai/rlcv/rl-tutorial/ray/dqn_inference_ray.py", line 76, in <module>
    main()
  File "/Users/psr/GitLab/psr.ai/rlcv/rl-tutorial/ray/dqn_inference_ray.py", line 33, in main
    algo = Algorithm.from_checkpoint(checkpoint.path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/psr/GitLab/psr.ai/rlcv/rl-tutorial/.venv/lib/python3.11/site-packages/ray/rllib/algorithms/algorithm.py", line 343, in from_checkpoint
    state = Algorithm._checkpoint_info_to_algorithm_state(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/psr/GitLab/psr.ai/rlcv/rl-tutorial/.venv/lib/python3.11/site-packages/ray/rllib/algorithms/algorithm.py", line 2876, in _checkpoint_info_to_algorithm_state
    state = pickle.load(f)
            ^^^^^^^^^^^^^^
TypeError: code() argument 13 must be str, not int

As you can see, I am calling Algorithm.from_checkpoint API, which internally calls pickle.load. Running the same code on linux works. What can be the issue?