# ArgumentError: array must be non-empty while calling Serialization.deserialize(f) function

**URL:** <https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508>\
**Category:** General Usage\
**Created:** [September 7, 2019, 6:10pm UTC](https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508 "2019-09-07T18:10:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [September 7, 2019, 6:10pm UTC](https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508/1 "2019-09-07T18:10:02Z")

</div>

The following is the code:

```julia
if use_cache && isfile(cachefile)
     f = open(cachefile, "r")
     res = Serialization.deserialize(f)
     close(f);
end

```

Then, I got an error, saying that “ArgumentError: array must be non-empty while calling Serialization.deserialize(f) function”. Sigh. I was wondering, does anyone know what might be wrong here?

---

<div class="post-metadata">

**Author:** ![kolia](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kolia](https://discourse.julialang.org/u/kolia)\
**Post date:** [July 16, 2020, 2:17pm UTC](https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508/2 "2020-07-16T14:17:30Z")

</div>

Can’t be sure what’s going on in your case, but this error often occurs when the versions of julia used to serialize and deserialize are not the same.
