# Problems with BSON

**URL:** https://discourse.julialang.org/t/problems-with-bson/103150
**Category:** General Usage
**Tags:** question, flux, bson, io, serialization
**Created:** [August 24, 2023, 11:47am UTC](https://discourse.julialang.org/t/problems-with-bson/103150 "2023-08-24T11:47:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Euhan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/euhan/32/36548_2.png) [@Euhan](https://discourse.julialang.org/u/Euhan)
#### Post date: [August 24, 2023, 11:47am UTC](https://discourse.julialang.org/t/problems-with-bson/103150/1 "2023-08-24T11:47:02Z")

</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 `bson_object = BSON.load("/pathy/path")`. Both of this give me:

```julia
BoundsError: attempt to access DataType at index [1]

```

I can, however, use `BSON.parse` without error, but in this case I don’t know what to do with the thing that is returned.

Looking at other topics I found this:  
[Error on load DataFrame with BSON](https://discourse.julialang.org/t/error-on-load-dataframe-with-bson/95634)

Here it says that one has to be consistent with what version of DataFrames one uses. Is this true? Because my problem seems identical and I don’t use DataFrames at all. I suspect it’s the version of BSON and/or Julia.

The models are saved some time ago from notebooks. I run the loading in notebooks. All of the mentioned notebooks reside in a directory called v1 and are marked to use a 1.6 kernel. This directory has its own `Project.toml` which is activated explicitly in each notebook in the first cell. In other directories I use other versions of Julia and have other environments.

Can this save/load incompatibility arise in spite of these precautions? What can I do about it?

Can some “forensics” be used on the bson-files or any other files to expose wherein  
the version conflict (if indeed that is what it is), lies?

I’m asking this because I want to placate an article reviewer by running some more experiments and I only have a very limited time to revise my article, so any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [August 28, 2023, 12:06pm UTC](https://discourse.julialang.org/t/problems-with-bson/103150/2 "2023-08-28T12:06:42Z")

</div>

> [@Euhan](#):
>
> Can some “forensics” be used on the bson-files or any other files to expose wherein  
> the version conflict (if indeed that is what it is), lies?

Just some ideas to get started:

What is the output of

```julia
BSON.parse("/pathy/path")

```

?  
This output is perhaps not readable enough because it is truncated.  
You may try

```julia
dump(BSON.parse("/pathy/path"))

```

(which again maybe is not readable because output is huge) and look for some object of type `DataType` or any hint in that direction which is related to the `BoundsError` you get.
