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

The following is the code:

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?

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.