Update atari_preprocessing.py
diff --git a/gym/wrappers/atari_preprocessing.py b/gym/wrappers/atari_preprocessing.py
index 03a33175453..e839b4a09f4 100644
--- a/gym/wrappers/atari_preprocessing.py
+++ b/gym/wrappers/atari_preprocessing.py
@@ -98,7 +98,6 @@ def __init__(
                 np.empty(env.observation_space.shape, dtype=np.uint8),
             ]
 
-        self.ale = env.unwrapped.ale
         self.lives = 0
         self.game_over = False
 
@@ -111,6 +110,11 @@ def __init__(
         self.observation_space = Box(
             low=_low, high=_high, shape=_shape, dtype=_obs_dtype
         )
+        
+    @property
+    def ale(self):
+        """Make ale as a class property to avoid serialization error"""
+        return self.env.unwrapped.ale
 
     def step(self, action):
         """Applies the preprocessing for an :meth:`env.step`."""

# Description

Fix AtariPreprocessing pickle error

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# Checklist:

- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `pre-commit run --all-files` (see `CONTRIBUTING.md` instructions to set it up)
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

<!--
As you go through the checklist above, you can mark something as done by putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
