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

dsharp.save/load with BinaryFormatter is blocked on .NET Interactive #33

Open
houstonhaynes opened this issue Feb 14, 2025 · 0 comments

Comments

@houstonhaynes
Copy link
Collaborator

dsharp.save/load with BinaryFormatter is blocked on .NET Interactive

Issue #440 | Created by @nhirschey | 2022-10-11 21:42:05 UTC |

Related to PR #430, .NET Interactive blocks BinaryFormatter, so this prevents model saving and loading in F# notebooks.

TorchSharp seems to be using BinaryWriter to get around this (e.g. here)

This is in VSCode using .ipynb notebook

#r "nuget: DiffSharp-lite"
open DiffSharp

dsharp.save(dsharp.tensor([1..10]), "test.params")

cell output:

Error: System.NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
   at DiffSharp.Util.UtilAutoOpens.saveBinary[T](T object, String fileName)
   at DiffSharp.Tensor.save(String fileName)
   at <StartupCode$FSI_0006>.$FSI_0006.main@()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant