# Serialization with RL4j

**URL:** https://community.konduit.ai/t/serialization-with-rl4j/1899
**Category:** RL4J
**Created:** [June 14, 2022, 10:42am UTC](https://community.konduit.ai/t/serialization-with-rl4j/1899 "2022-06-14T10:42:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marcus.frex](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/marcus.frex/32/762_2.png) [@marcus.frex](https://community.konduit.ai/u/marcus.frex)
#### Post date: [June 14, 2022, 10:42am UTC](https://community.konduit.ai/t/serialization-with-rl4j/1899/1 "2022-06-14T10:42:27Z")

</div>

Hello everyone,

I am working with NStepQLearning model but it seems just saving ComputationGraph it is using is not enough because when i restored the model it does not give the same results given before.

Do you guys have any idea how? Or am I missing something?

---

<div class="post-metadata">

### Author: ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)
#### Post date: [June 22, 2022, 12:39pm UTC](https://community.konduit.ai/t/serialization-with-rl4j/1899/2 "2022-06-22T12:39:08Z")

</div>

@marcus.frex could you clarify your issue a bit? Also please note that rl4j was moved to a contrib module recently (1.0.0-M1.1 and newer) in new releases since it’s not heavily maintained.

Generally saving the weights should be enough. It’s hard to tell without knowing more info though.

---

<div class="post-metadata">

### Author: ![marcus.frex](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/marcus.frex/32/762_2.png) [@marcus.frex](https://community.konduit.ai/u/marcus.frex)
#### Post date: [June 22, 2022, 2:33pm UTC](https://community.konduit.ai/t/serialization-with-rl4j/1899/3 "2022-06-22T14:33:52Z")

</div>

@agibsonccc Probably I am missing something but let’s say a DQNPolicy trained with a specific QLearning configuration does not give the same score after I save it and load after a specific Epoch.

I noticed that even I use same DQNPolicy and run through the same MDP (Environment) separately it still does not return the same score. I event set target update frequency to 1 but it still does not returns the same score. I event saved MultiLayerNetwork manually but it does not gets the same score after I run again the same dataset.

Have you ever experienced something like that? What do you think am I missing?

---

<div class="post-metadata">

### Author: ![marcus.frex](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/marcus.frex/32/762_2.png) [@marcus.frex](https://community.konduit.ai/u/marcus.frex)
#### Post date: [June 23, 2022, 7:40am UTC](https://community.konduit.ai/t/serialization-with-rl4j/1899/4 "2022-06-23T07:40:47Z")

</div>

Ok, I found what am I missing. 🙂 It seems that on training course it can create random actions to improve NNs abilitiy. All epoc results should get compared with actual data scores too.
