# \#serialization

**URL:** https://discourse.julialang.org/tag/serialization/697.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Is it posible to serialize a Makie.Figure object?](https://discourse.julialang.org/t/is-it-posible-to-serialize-a-makie-figure-object/134686)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 2\
**Last updated:** [December 24, 2025, 4:33am UTC](https://discourse.julialang.org/t/is-it-posible-to-serialize-a-makie-figure-object/134686 "2025-12-24T04:33:04Z")

</div>

I’ve tried with JLD2 and Serialization. InJLD2, the warnings were, it can’t save anonymous functions, while Serialization errored with “cannot serialize a running Task”. So probably no chance? This is the context.

---

## [Does writing in parallel block the whole process?](https://discourse.julialang.org/t/does-writing-in-parallel-block-the-whole-process/134620)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 4\
**Last updated:** [December 19, 2025, 8:37pm UTC](https://discourse.julialang.org/t/does-writing-in-parallel-block-the-whole-process/134620 "2025-12-19T20:37:43Z")

</div>

Say I have a large piece of data data that I want to write or serialize (for speed) to a file file with serialize("path/to/file", data). Done naively, this will block the rest of the program from executing. So it’s simp…

---

## [JLD2 - load from IOBuffer](https://discourse.julialang.org/t/jld2-load-from-iobuffer/67641)

<div class="topic-metadata">

**Author:** [@cwiese](https://discourse.julialang.org/u/cwiese)\
**Replies:** 5\
**Last updated:** [November 20, 2025, 9:04pm UTC](https://discourse.julialang.org/t/jld2-load-from-iobuffer/67641 "2025-11-20T21:04:33Z")

</div>

I am not finding a method to load a JLD2 file using JLD2.load() from IOBuffer. This seems basic for saving and loading to cloud like S3 or Azure Blob storage (which is my case). I would like to avoid reading from a REST …

---

## [How can the Julia language write a structure to a file and read that structure from the file?](https://discourse.julialang.org/t/how-can-the-julia-language-write-a-structure-to-a-file-and-read-that-structure-from-the-file/129436)

<div class="topic-metadata">

**Author:** [@dk-zen](https://discourse.julialang.org/u/dk-zen)\
**Replies:** 5\
**Last updated:** [May 30, 2025, 4:57am UTC](https://discourse.julialang.org/t/how-can-the-julia-language-write-a-structure-to-a-file-and-read-that-structure-from-the-file/129436 "2025-05-30T04:57:50Z")

</div>

How can the Julia language write a structure to a file and read that structure from the file? I tried it myself. Although I could read it correctly, when there are dozens of keywords in the structure, the reading process…

---

## [Serializing a Module](https://discourse.julialang.org/t/serializing-a-module/84458)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 4\
**Last updated:** [May 1, 2025, 1:40pm UTC](https://discourse.julialang.org/t/serializing-a-module/84458 "2025-05-01T13:40:07Z")

</div>

Hi, is it possible to deserialize a Module in a new process to get that module (without defining it in the second process first)? I get the following error message when I use the Serialization library as follows Proces…

---

## [Save a simplified ModelingToolkit problem as text](https://discourse.julialang.org/t/save-a-simplified-modelingtoolkit-problem-as-text/128124)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 6\
**Last updated:** [April 19, 2025, 7:56pm UTC](https://discourse.julialang.org/t/save-a-simplified-modelingtoolkit-problem-as-text/128124 "2025-04-19T19:56:03Z")

</div>

Because structural\_simplify is slow, I want to write the simplified system to a file, from where I can load it later. Using serialize("sys.bin", sys) works, but this causes problems when switching between julia versions,…

---

## [Serializing many different arrays incrementally over time](https://discourse.julialang.org/t/serializing-many-different-arrays-incrementally-over-time/117777)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 5\
**Last updated:** [March 14, 2025, 4:17am UTC](https://discourse.julialang.org/t/serializing-many-different-arrays-incrementally-over-time/117777 "2025-03-14T04:17:13Z")

</div>

I have a simulation that’s going to run for a long time, producing a lot of results, and I need those results to go do disk while the sim is running rather than all at once at the end (not enough RAM for all those result…

---

## [How to easily save Julia data?](https://discourse.julialang.org/t/how-to-easily-save-julia-data/125955)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 5\
**Last updated:** [February 16, 2025, 8:32pm UTC](https://discourse.julialang.org/t/how-to-easily-save-julia-data/125955 "2025-02-16T20:32:24Z")

</div>

Hi guys, I am wondering is there a way like pickle in python to save the output data from Julia calculations? maybe it can support arrays, dict, tuples? for example, if I have a dict of which each key stores a different…

---

## [Best way to store a dataset with specific structure](https://discourse.julialang.org/t/best-way-to-store-a-dataset-with-specific-structure/125238)

<div class="topic-metadata">

**Author:** [@danieleavitabile](https://discourse.julialang.org/u/danieleavitabile)\
**Replies:** 7\
**Last updated:** [January 27, 2025, 2:53pm UTC](https://discourse.julialang.org/t/best-way-to-store-a-dataset-with-specific-structure/125238 "2025-01-27T14:53:39Z")

</div>

I am new to Julia and I must store and access a weirdly shaped dataset, for which I would like to ask your advice. It’s not very easy to explain what I must do. I must store in a variable, let say A, a collection of poi…

---

## [Trying to serialize runtime generated function and MTK ODESystem](https://discourse.julialang.org/t/trying-to-serialize-runtime-generated-function-and-mtk-odesystem/119961)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 5\
**Last updated:** [September 28, 2024, 11:52am UTC](https://discourse.julialang.org/t/trying-to-serialize-runtime-generated-function-and-mtk-odesystem/119961 "2024-09-28T11:52:37Z")

</div>

I have a system with around 1500 equations. It takes a long time to run the following function, so I want to serialize and deserialize f\_ip, dvs, psym and io\_sys so I can use them between sessions. (\_, f\_ip), dvs, psym,…

---

## [JSON.jl Float64 serialization (suppress scientific notation)](https://discourse.julialang.org/t/json-jl-float64-serialization-suppress-scientific-notation/119775)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 0\
**Last updated:** [September 23, 2024, 9:04pm UTC](https://discourse.julialang.org/t/json-jl-float64-serialization-suppress-scientific-notation/119775 "2024-09-23T21:04:35Z")

</div>

I am having a hard time with JSON.jl. I want to serialize large Float64 instances without scientific notation and the only way I was able to get at least the rounding working results in a string, instead of a float value…

---

## [Trouble trying to serialize JuMP Models to .mps, .lp, .rew formats](https://discourse.julialang.org/t/trouble-trying-to-serialize-jump-models-to-mps-lp-rew-formats/117425)

<div class="topic-metadata">

**Author:** [@gangway](https://discourse.julialang.org/u/gangway)\
**Replies:** 3\
**Last updated:** [July 25, 2024, 8:21pm UTC](https://discourse.julialang.org/t/trouble-trying-to-serialize-jump-models-to-mps-lp-rew-formats/117425 "2024-07-25T20:21:17Z")

</div>

I am trying to serialize JuMP Models to .mps, .lp, .rew formats via write\_to\_file method. But I am facing the same error with all three conversion while the .nl conversion is successful: MathOptInterface.UnsupportedCon…

---

## [How to read a file and initialize tensors with it's values without having it in memory?](https://discourse.julialang.org/t/how-to-read-a-file-and-initialize-tensors-with-its-values-without-having-it-in-memory/117418)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 6\
**Last updated:** [July 25, 2024, 9:58am UTC](https://discourse.julialang.org/t/how-to-read-a-file-and-initialize-tensors-with-its-values-without-having-it-in-memory/117418 "2024-07-25T09:58:06Z")

</div>

I have a simple (but possibly enormous) text file which has five columns, the first one has a floating point value and the other four have integer values , it looks like F p q r s where basically I want to write a tens…

---

## [Parquet2.jl 0.2.25 outputting corrupted files (0.2.26 fix now up)](https://discourse.julialang.org/t/parquet2-jl-0-2-25-outputting-corrupted-files-0-2-26-fix-now-up/117102)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 5\
**Last updated:** [July 19, 2024, 6:29pm UTC](https://discourse.julialang.org/t/parquet2-jl-0-2-25-outputting-corrupted-files-0-2-26-fix-now-up/117102 "2024-07-19T18:29:10Z")

</div>

Recently there has been a change in the parquet thrift metadata schema which I included in Parquet2.jl as of 0.2.25. Unfortunately it looks like this is now outputting corrupt files in many circumstances (can confirm th…

---

## [\[ANN\] Parquet2.jl](https://discourse.julialang.org/t/ann-parquet2-jl/69274)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 20\
**Last updated:** [May 8, 2024, 5:30am UTC](https://discourse.julialang.org/t/ann-parquet2-jl/69274 "2024-05-08T05:30:37Z")

</div>

Parquet2.jl A little something I’ve been working on for the past few weeks. This package is not yet registered because I would like to try to get the community’s help with a bit more testing before registering it. Parq…

---

## [How is \`deepcopy\` so clever regarding aliasing and self-reference?](https://discourse.julialang.org/t/how-is-deepcopy-so-clever-regarding-aliasing-and-self-reference/113235)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 4\
**Last updated:** [April 19, 2024, 1:43pm UTC](https://discourse.julialang.org/t/how-is-deepcopy-so-clever-regarding-aliasing-and-self-reference/113235 "2024-04-19T13:43:10Z")

</div>

I find this behaviour very fortunate, but also black magic: a = \[5\] u = \[a, a, a\] v = deepcopy(u) v\[1\]\[1\] = 8 v # \[\[8\], \[8\], \[8\]\] # My naive 'deepcopy' would have produced \[\[8\], \[5\], \[5\]\] instead. I expected deepcopy …

---

## [Deserialize a dictionnary and removing one element](https://discourse.julialang.org/t/deserialize-a-dictionnary-and-removing-one-element/108312)

<div class="topic-metadata">

**Author:** [@virgile-baudrot](https://discourse.julialang.org/u/virgile-baudrot)\
**Replies:** 0\
**Last updated:** [January 3, 2024, 5:33pm UTC](https://discourse.julialang.org/t/deserialize-a-dictionnary-and-removing-one-element/108312 "2024-01-03T17:33:06Z")

</div>

I saved a dictionnary using the Serialization package. It worked well. Unfortunatelly one of the element was bad defined (a function with elements not recognize… which I do not understand why since I thought it was comp…

---

## [How to serialize data to, and deserialize from, postgres?](https://discourse.julialang.org/t/how-to-serialize-data-to-and-deserialize-from-postgres/103803)

<div class="topic-metadata">

**Author:** [@John\_Boik](https://discourse.julialang.org/u/John_Boik)\
**Replies:** 9\
**Last updated:** [September 25, 2023, 1:29pm UTC](https://discourse.julialang.org/t/how-to-serialize-data-to-and-deserialize-from-postgres/103803 "2023-09-25T13:29:18Z")

</div>

I would like to store some Julia data in a PostgreSQL bytea column and then query the database and convert the result back to its original form. I can store the data, but can’t seem to convert the query response correctl…

---

## [Serialization error when using \`MPI.gather\`](https://discourse.julialang.org/t/serialization-error-when-using-mpi-gather/103802)

<div class="topic-metadata">

**Author:** [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Replies:** 5\
**Last updated:** [September 14, 2023, 5:04am UTC](https://discourse.julialang.org/t/serialization-error-when-using-mpi-gather/103802 "2023-09-14T05:04:12Z")

</div>

Hi there, I’ve recently added support for multi-threading to CounterfactualExplanations.jl. This has been my first time using MPI so there are probably many things that can be improved here (any thoughts very much welco…

---

## [Problems with BSON](https://discourse.julialang.org/t/problems-with-bson/103150)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 1\
**Last updated:** [August 28, 2023, 12:06pm UTC](https://discourse.julialang.org/t/problems-with-bson/103150 "2023-08-28T12:06:42Z")

</div>

This has been discussed before, but I can’t say that I have fully understood all intricacies of the problem. I try to load an object (flux model) with BSON.@load "/pathy/path" model. I have also tried to load it with bs…

---

## [Loading views from serialized file disconnects memory link](https://discourse.julialang.org/t/loading-views-from-serialized-file-disconnects-memory-link/102335)

<div class="topic-metadata">

**Author:** [@mwhisena](https://discourse.julialang.org/u/mwhisena)\
**Replies:** 0\
**Last updated:** [July 31, 2023, 9:31pm UTC](https://discourse.julialang.org/t/loading-views-from-serialized-file-disconnects-memory-link/102335 "2023-07-31T21:31:10Z")

</div>

I have a large matrix of data that I wish to create hundreds of views from. These views help me with setindexing and actually using my data in the program. This works perfectly for me, especially if I want to deepcopy to…

---

## [Is serialization a safe option for data storage?](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872)

<div class="topic-metadata">

**Author:** [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Replies:** 2\
**Last updated:** [May 15, 2023, 12:06pm UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872 "2023-05-15T12:06:25Z")

</div>

In my code i last used text files to pass parameters and these parameters are finally processed and used in structs. I was wondering if I could save these structs directly to reduce the overhead in the code. One method …

---

## [Serialization format allow incremental write to file](https://discourse.julialang.org/t/serialization-format-allow-incremental-write-to-file/95464)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 10\
**Last updated:** [March 12, 2023, 7:11pm UTC](https://discourse.julialang.org/t/serialization-format-allow-incremental-write-to-file/95464 "2023-03-12T19:11:50Z")

</div>

Is there any data format that supports incremental writes and allows flush to the file after the write? I find julia-arrow support incremental writes here: refactor Arrow.write to support incremental writes by baumgold ·…

---

## [Is it possible to predict the serialized size of an object, without serializing it?](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769)

<div class="topic-metadata">

**Author:** [@cadaverous](https://discourse.julialang.org/u/cadaverous)\
**Replies:** 5\
**Last updated:** [February 24, 2023, 4:48am UTC](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769 "2023-02-24T04:48:18Z")

</div>

Hello all! I am pretty much brand new to Julia, and I am trying to write an interface between Julia and a C library that uses MPI. The problem I’m having is that the library needs to be able to pack Julia objects into a…

---

## [Using Serialization to store then load a lambdified function?](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884)

<div class="topic-metadata">

**Author:** [@pluie](https://discourse.julialang.org/u/pluie)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 11:08am UTC](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884 "2023-01-30T11:08:26Z")

</div>

I have a lengthy symbolic expression that I find and lambdify in one function once. I hope to use this lambdified function repeatedly in a different function. It takes about a minute for lambdify to execute, so I do not …

---

## [Deserialize does not work when reopen](https://discourse.julialang.org/t/deserialize-does-not-work-when-reopen/92892)

<div class="topic-metadata">

**Author:** [@JNSDVD](https://discourse.julialang.org/u/JNSDVD)\
**Replies:** 2\
**Last updated:** [January 12, 2023, 7:55pm UTC](https://discourse.julialang.org/t/deserialize-does-not-work-when-reopen/92892 "2023-01-12T19:55:42Z")

</div>

Hey guys, I do not understand why the first code returns true while it does not work when I close the Jupyter Notebook, open it again and run only the second code. Of course the file XX.jls is still in the same folder …

---

## [Parsing ProtoBuf Text Format](https://discourse.julialang.org/t/parsing-protobuf-text-format/84721)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 8:59am UTC](https://discourse.julialang.org/t/parsing-protobuf-text-format/84721 "2022-11-09T08:59:17Z")

</div>

Hi, I’m trying to use ProtoBuf.jl to deserialize objects. Managed to generate code from .proto files Now I want to read and write objects with Protocol Buffer Text Format Language Specification. However, I could only …

---

## [Efficient serialization of JuMP results](https://discourse.julialang.org/t/efficient-serialization-of-jump-results/87896)

<div class="topic-metadata">

**Author:** [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Replies:** 5\
**Last updated:** [September 28, 2022, 11:06pm UTC](https://discourse.julialang.org/t/efficient-serialization-of-jump-results/87896 "2022-09-28T23:06:00Z")

</div>

What is a recommended workflow for efficiently serialising results data after solving a JuMP model? The information in the numbers are the important thing, not preserving the Julia object structure. For example, does an…

---

## [Reading Python datastructure (from text file) in Julia](https://discourse.julialang.org/t/reading-python-datastructure-from-text-file-in-julia/83261)

<div class="topic-metadata">

**Author:** [@gvdeynde](https://discourse.julialang.org/u/gvdeynde)\
**Replies:** 3\
**Last updated:** [June 23, 2022, 6:54pm UTC](https://discourse.julialang.org/t/reading-python-datastructure-from-text-file-in-julia/83261 "2022-06-23T18:54:29Z")

</div>

Hi I have a file with a nested data structure, coming from a Python tool, that I would like to read in Julia. It’s basically a list with each item of the list being a dict which in its turn contains key/value-pairs of a…

---

## [Efficient serialization across system images](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 4:28pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781 "2022-04-21T16:28:16Z")

</div>

I’ve got a dictionary containing only String keys mapping to Numbers. This is the result of a computation that runs on a server. Since I make use of PyJulia to initiate the computation from a Python app, I’m using a cust…

[Next page](https://discourse.julialang.org/tag/serialization/697.md?match_all_tags=true&page=1&tags%5B%5D=serialization)
