# \#jld2

**URL:** https://discourse.julialang.org/tag/jld2/171.md

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

---

## [Stream into JLD2 file](https://discourse.julialang.org/t/stream-into-jld2-file/134025)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 8\
**Last updated:** [November 22, 2025, 11:57am UTC](https://discourse.julialang.org/t/stream-into-jld2-file/134025 "2025-11-22T11:57:48Z")

</div>

I am trying to write a larger than memory dataset to a JLD2 file in a streaming way. That dataset is generated by an iterator of known length and element type. So I thought I could use JLD2.create\_dataset() to create tha…

---

## [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 …

---

## [Problems installing Agents under v1.12.0](https://discourse.julialang.org/t/problems-installing-agents-under-v1-12-0/133215)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 4\
**Last updated:** [October 17, 2025, 4:42am UTC](https://discourse.julialang.org/t/problems-installing-agents-under-v1-12-0/133215 "2025-10-17T04:42:06Z")

</div>

Hi. I’ve just returned to julia after absence and have installed version 1.12.0. I now have problems installing and loading a set of 8 packages relating to Agents. Here is the Pkg output: (@v1.12) pkg\> up Agents Upd…

---

## [JLD2 CodecLz4 compression stopped working](https://discourse.julialang.org/t/jld2-codeclz4-compression-stopped-working/132249)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 2\
**Last updated:** [September 10, 2025, 1:07pm UTC](https://discourse.julialang.org/t/jld2-codeclz4-compression-stopped-working/132249 "2025-09-10T13:07:37Z")

</div>

Hi, all of a sudden, compressing a Jld2 with Lz4 throws an error: using JLD2 using CodecLz4 name = rand(10) detail = rand(10) values = rand(10) jldopen("./test.jdl2", "w"; compress = LZ4FrameCompressor()) do f …

---

## [Loading Lux params and states in a new script](https://discourse.julialang.org/t/loading-lux-params-and-states-in-a-new-script/131370)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [August 5, 2025, 11:49am UTC](https://discourse.julialang.org/t/loading-lux-params-and-states-in-a-new-script/131370 "2025-08-05T11:49:29Z")

</div>

To save a model the Training a Simple Lstm tutorial shows the following using JDL2 package # train.jl using JLD2 @save "trained\_model.jld2" ps\_trained st\_trained @load "trained\_model.jld2" ps\_trained st\_trained But th…

---

## [Is there a way to load only a part of a dataset in a JLD2 file?](https://discourse.julialang.org/t/is-there-a-way-to-load-only-a-part-of-a-dataset-in-a-jld2-file/127835)

<div class="topic-metadata">

**Author:** [@kockahonza](https://discourse.julialang.org/u/kockahonza)\
**Replies:** 3\
**Last updated:** [April 8, 2025, 11:34am UTC](https://discourse.julialang.org/t/is-there-a-way-to-load-only-a-part-of-a-dataset-in-a-jld2-file/127835 "2025-04-08T11:34:51Z")

</div>

Hi, the question is pretty much the title. I’ve ran a largeish computation on a cluster with lots of ram so it can fit its results (the largest of which is a 8 dimensional array of vectors of vectors which is probably no…

---

## [Saving and loading ODEProblems created by ModelingToolkit](https://discourse.julialang.org/t/saving-and-loading-odeproblems-created-by-modelingtoolkit/127629)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 2\
**Last updated:** [April 5, 2025, 1:03pm UTC](https://discourse.julialang.org/t/saving-and-loading-odeproblems-created-by-modelingtoolkit/127629 "2025-04-05T13:03:25Z")

</div>

Hello all. I have question about the saving and loading ODEProblems created from Modeling Toolkit (MTK) models. Specifically, when I create and MTK model, build an ODE problem from that, save the ODE problem using JLD2, …

---

## [Saving Delaunay Triangulation](https://discourse.julialang.org/t/saving-delaunay-triangulation/127004)

<div class="topic-metadata">

**Author:** [@Varun\_V](https://discourse.julialang.org/u/Varun_V)\
**Replies:** 5\
**Last updated:** [March 16, 2025, 10:20pm UTC](https://discourse.julialang.org/t/saving-delaunay-triangulation/127004 "2025-03-16T22:20:05Z")

</div>

I’d like to save a triangulation I’ve created using DelaunayTriangulation.jl. I have tried using JLD2 but am unable to. I feel like this should be easy so I’m probably doing something wrong. using DelaunayTriangulation,…

---

## [Why JLD2.jl is 40x slower than Arrow.jl](https://discourse.julialang.org/t/why-jld2-jl-is-40x-slower-than-arrow-jl/122217)

<div class="topic-metadata">

**Author:** [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Replies:** 24\
**Last updated:** [November 25, 2024, 9:59am UTC](https://discourse.julialang.org/t/why-jld2-jl-is-40x-slower-than-arrow-jl/122217 "2024-11-25T09:59:38Z")

</div>

I have this gist: JLD2 is actually simply for reading in a 30 MB file with keys =\> randn(500) is 40x slower than Arrow.jl. How? I mean how come JLD2 generality sacrificed 40x speed difference?

---

## [Jld2 preview in vscode?](https://discourse.julialang.org/t/jld2-preview-in-vscode/80050)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 9\
**Last updated:** [August 21, 2024, 4:43pm UTC](https://discourse.julialang.org/t/jld2-preview-in-vscode/80050 "2024-08-21T16:43:18Z")

</div>

I use JLD2.jl to store simulation results which I find pretty convenient. I wonder if there is a plan to add a preview/explorer feature for this type of file in vscode. Json files are nicer for a having a quick look on…

---

## [Saving and loading model with Flux.jl](https://discourse.julialang.org/t/saving-and-loading-model-with-flux-jl/118328)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 2\
**Last updated:** [August 18, 2024, 11:11am UTC](https://discourse.julialang.org/t/saving-and-loading-model-with-flux-jl/118328 "2024-08-18T11:11:05Z")

</div>

I want to save and load trained model with jld2. The model is just getStarted example from Flux documentation, and it works perfectly fine, without saving and loading step, but I want to plot the data with previously tra…

---

## [Saving/loading a neural network trained with NeuralPDE](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583)

<div class="topic-metadata">

**Author:** [@gradureau](https://discourse.julialang.org/u/gradureau)\
**Replies:** 3\
**Last updated:** [July 30, 2024, 4:42pm UTC](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583 "2024-07-30T16:42:39Z")

</div>

Hello everybody, I am using neuralPDE to train neural networks and I wish to save them in files to use them later. It works just fine if I use the standard Lux layers. Yet I wish to use the following custom layer at the…

---

## [Group attributes with JLD2](https://discourse.julialang.org/t/group-attributes-with-jld2/114302)

<div class="topic-metadata">

**Author:** [@bmxam](https://discourse.julialang.org/u/bmxam)\
**Replies:** 7\
**Last updated:** [May 21, 2024, 1:26pm UTC](https://discourse.julialang.org/t/group-attributes-with-jld2/114302 "2024-05-21T13:26:51Z")

</div>

I’m starting to use the JLD2.jl package to read an HDF5 file. I am bit confused about the way attributes of Group should be accessed. It seems to me that the parent node of the group is always needed to access the group …

---

## [Error with JLD2 load function](https://discourse.julialang.org/t/error-with-jld2-load-function/114495)

<div class="topic-metadata">

**Author:** [@Kreetta\_Hamalainen](https://discourse.julialang.org/u/Kreetta_Hamalainen)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 8:01am UTC](https://discourse.julialang.org/t/error-with-jld2-load-function/114495 "2024-05-21T08:01:29Z")

</div>

Hi all, New to Julia, and don’t quite know where to start with this error. Happens when trying to reload all parameters including ODE related parameters with JLD2 load() function. Fatal error: ERROR: LoadError: Method…

---

## [JLD2: How to update existing dataset array on disk?](https://discourse.julialang.org/t/jld2-how-to-update-existing-dataset-array-on-disk/111103)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 5\
**Last updated:** [March 5, 2024, 2:27am UTC](https://discourse.julialang.org/t/jld2-how-to-update-existing-dataset-array-on-disk/111103 "2024-03-05T02:27:21Z")

</div>

I am trying to update parts of an array stored inside a .jld2 file. However, all the changes that I make are not actually stored to disk. As an MWP, imagine doing using JLD2 a = zeros(100,100) jldsave("test.jld2"; a=a…

---

## [Problems saving/opening ODESolution from SciML with JLD2](https://discourse.julialang.org/t/problems-saving-opening-odesolution-from-sciml-with-jld2/106958)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 12\
**Last updated:** [December 2, 2023, 12:49am UTC](https://discourse.julialang.org/t/problems-saving-opening-odesolution-from-sciml-with-jld2/106958 "2023-12-02T00:49:40Z")

</div>

I define a custom struct to hold the parameters for the coupled ODEs I’m solving with OrdinaryDiffEq.jl, which typically stores various numbers and arrays (1D or 2D), as well as vectors of dualcache vectors in par.dualca…

---

## [Ideas for Saving Intermediate Results](https://discourse.julialang.org/t/ideas-for-saving-intermediate-results/106724)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 7\
**Last updated:** [November 29, 2023, 8:44am UTC](https://discourse.julialang.org/t/ideas-for-saving-intermediate-results/106724 "2023-11-29T08:44:52Z")

</div>

Hello, I’d appreciate any thoughts or feedback on how I could implement the following. I have a long-running simulation (several days) I run on my university’s HPC. Till now I have been saving the results at the end of…

---

## [How to solve the error while loading saved chain as JLD2 file or JLS file?](https://discourse.julialang.org/t/how-to-solve-the-error-while-loading-saved-chain-as-jld2-file-or-jls-file/36031)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 6\
**Last updated:** [August 31, 2023, 1:52pm UTC](https://discourse.julialang.org/t/how-to-solve-the-error-while-loading-saved-chain-as-jld2-file-or-jls-file/36031 "2023-08-31T13:52:39Z")

</div>

Hi, I have saved the chain that generated using Turing package as below: using JLD2, FileIO using Turing # Set the true probability of heads in a coin. p\_true = 0.5 # Iterate from having seen 0 observations t…

---

## [Storing huge amount of data efficiently](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 15\
**Last updated:** [February 24, 2023, 9:21am UTC](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818 "2023-02-24T09:21:37Z")

</div>

Hello, I am performing some numerical computations and I have the necessity to run a huge (say, several thousand of iterations) for loop. Each iteration produces a certain amount of data that I need to store in the disk…

---

## [How to save a large Float32 array on disk using data compression (failed attempt with JLD2)?](https://discourse.julialang.org/t/how-to-save-a-large-float32-array-on-disk-using-data-compression-failed-attempt-with-jld2/77413)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 2\
**Last updated:** [January 24, 2023, 9:13am UTC](https://discourse.julialang.org/t/how-to-save-a-large-float32-array-on-disk-using-data-compression-failed-attempt-with-jld2/77413 "2023-01-24T09:13:54Z")

</div>

I would like to save a large array on disk using if possible some type of data compression to save disk space. Then, I would like to read the file in Julia for future usage. My attempt below using JLD2 works only for sma…

---

## [Reading DataFrames from JLD2 files](https://discourse.julialang.org/t/reading-dataframes-from-jld2-files/88543)

<div class="topic-metadata">

**Author:** [@ehsani63](https://discourse.julialang.org/u/ehsani63)\
**Replies:** 9\
**Last updated:** [January 16, 2023, 12:58pm UTC](https://discourse.julialang.org/t/reading-dataframes-from-jld2-files/88543 "2023-01-16T12:58:00Z")

</div>

The results of my simulations are saved as DataFrames in JLD2 files: struct Sim params::Dict adf::DataFrame model::ABM end # Running simulations and generating results... ... sim = Sim(d, adf, model) # con…

---

## [Saving/exporting objects on hard drive](https://discourse.julialang.org/t/saving-exporting-objects-on-hard-drive/90492)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 6\
**Last updated:** [November 19, 2022, 1:33pm UTC](https://discourse.julialang.org/t/saving-exporting-objects-on-hard-drive/90492 "2022-11-19T13:33:39Z")

</div>

I am trying to save/export objects in memory to my hard drive. I have found two packages that should allow me to do that: JLD and JLD2. However, both only return errors. Has anyone an idea on how to do that/where my err…

---

## [Probe if a variable exists in a JLD2-file](https://discourse.julialang.org/t/probe-if-a-variable-exists-in-a-jld2-file/88969)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 3\
**Last updated:** [October 19, 2022, 3:31pm UTC](https://discourse.julialang.org/t/probe-if-a-variable-exists-in-a-jld2-file/88969 "2022-10-19T15:31:59Z")

</div>

Is there a way to probe / evaluate if a variable exists in a JLD2-file?

---

## [Serializing nested Dicts (or DataFrames) so that they can (easily) be loaded in Python as well?](https://discourse.julialang.org/t/serializing-nested-dicts-or-dataframes-so-that-they-can-easily-be-loaded-in-python-as-well/82809)

<div class="topic-metadata">

**Author:** [@daharn](https://discourse.julialang.org/u/daharn)\
**Replies:** 3\
**Last updated:** [June 15, 2022, 10:21pm UTC](https://discourse.julialang.org/t/serializing-nested-dicts-or-dataframes-so-that-they-can-easily-be-loaded-in-python-as-well/82809 "2022-06-15T22:21:06Z")

</div>

From my simulations, I typically end up with (somewhat convoluted) Dicts and/or DataFrames made from these dicts that contain my input parameters as well as my results. Depending on the complexity of the results, they mi…

---

## [Exporting and importing a 3D matrix](https://discourse.julialang.org/t/exporting-and-importing-a-3d-matrix/81300)

<div class="topic-metadata">

**Author:** [@CactusHamster](https://discourse.julialang.org/u/CactusHamster)\
**Replies:** 4\
**Last updated:** [May 19, 2022, 9:53am UTC](https://discourse.julialang.org/t/exporting-and-importing-a-3d-matrix/81300 "2022-05-19T09:53:42Z")

</div>

We generate a matrix like this for i = 1:5 for j = 1:5 for k = 1:5 d\[i, j, k\] = rand(1) end end end Is there an easy way to save matrix d somewhere and later on just call it and use it? With …

---

## [JLD2 Error: "type DataType has no field mutable"](https://discourse.julialang.org/t/jld2-error-type-datatype-has-no-field-mutable/78651)

<div class="topic-metadata">

**Author:** [@poopsilon](https://discourse.julialang.org/u/poopsilon)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 12:56pm UTC](https://discourse.julialang.org/t/jld2-error-type-datatype-has-no-field-mutable/78651 "2022-03-29T12:56:29Z")

</div>

I’d like to save variables for later. To do this, I installed the JLD2 package. But when I try to save, I get the following error: Error Detailsjulia\> using JLD2 julia\> hello = "world" "world"…

---

## [How to save a structure instance (inside module) in JLD2, to load it later correctly?](https://discourse.julialang.org/t/how-to-save-a-structure-instance-inside-module-in-jld2-to-load-it-later-correctly/78339)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 10\
**Last updated:** [March 24, 2022, 2:11pm UTC](https://discourse.julialang.org/t/how-to-save-a-structure-instance-inside-module-in-jld2-to-load-it-later-correctly/78339 "2022-03-24T14:11:19Z")

</div>

What should I add in initilizeFile.jl to make readingFile.jl gives the type of Sim as Simulation not JLD2.ReconstructedTypes.var"##Main.readApp.Simulation#292"(2.0, 4.0) with warning? initilizeFile.jl is: module readAp…

---

## [Warning: type does not exist in workspace; reconstructing](https://discourse.julialang.org/t/warning-type-does-not-exist-in-workspace-reconstructing/78232)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 1\
**Last updated:** [March 22, 2022, 8:11am UTC](https://discourse.julialang.org/t/warning-type-does-not-exist-in-workspace-reconstructing/78232 "2022-03-22T08:11:22Z")

</div>

I was using the below code to create .jld2 file containing an instance Sim of structure Simulation include("./SimulationStructure.jl"); function appFunction() Sim = Simulation(); io = open("$(@\_\_DIR\_\_)/generatedElements…

---

## [Is there a way to write a function into JLD or other h5 file?](https://discourse.julialang.org/t/is-there-a-way-to-write-a-function-into-jld-or-other-h5-file/77718)

<div class="topic-metadata">

**Author:** [@vavrines](https://discourse.julialang.org/u/vavrines)\
**Replies:** 8\
**Last updated:** [March 15, 2022, 7:23pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-write-a-function-into-jld-or-other-h5-file/77718 "2022-03-15T19:23:37Z")

</div>

Wondering if there is a way to write a defined function into file. A MWE is using JLD2 f(x) = x^2 @save "f.jld2" f For this case, if I close the current session and execute the following code using JLD2 @load "f.jld2…

---

## [JLD2 type compatibility](https://discourse.julialang.org/t/jld2-type-compatibility/77684)

<div class="topic-metadata">

**Author:** [@Alessio\_Bellisomi](https://discourse.julialang.org/u/Alessio_Bellisomi)\
**Replies:** 2\
**Last updated:** [March 11, 2022, 12:37pm UTC](https://discourse.julialang.org/t/jld2-type-compatibility/77684 "2022-03-11T12:37:24Z")

</div>

I am using JLD2 to store some data in struct format, it works great. However some of the objects need to change, as I need to add more members. e.g. struct A n::Int a::String end might become struct A n::…

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