Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialization in Julia code blocks can throw an error. #2531

Open
ablaom opened this issue Jun 17, 2024 · 2 comments
Open

Deserialization in Julia code blocks can throw an error. #2531

ablaom opened this issue Jun 17, 2024 · 2 comments

Comments

@ablaom
Copy link

ablaom commented Jun 17, 2024

The error I'm seeing is the same one reported in this Julia issue, which I'm pretty sure explains the problem, since Documenter.jl wraps code in anonymous modules, right?

@mortenpi
Copy link
Member

Documenter.jl wraps code in anonymous modules, right?

Yes it does.

@ablaom
Copy link
Author

ablaom commented Jun 17, 2024

For a little more context, I'm getting the error below when I change julia to @example MNIST here.

┌ Warning: failed to run `@example` block in src/extended_examples/MNIST/notebook.md:328-331```@example MNIST
│ mach2 = machine(joinpath(tempdir(), "mnist3.jls"))
│ predict_mode(mach2, images[501:503])
```
│   exception =
│    UndefVarError: `__atexample__named__MNIST` not defined
│    Stacktrace:
│      [1] deserialize_module(s::Serialization.Serializer{IOStream})
│        @ Serialization /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Serialization/src/Serialization.jl:997

| Yes it does.

Then I'm guessing there so easy workaround or adaptation, apart from not evaluating the block as I am doing here, and we will need to wait on the Julia issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants