Unable to use Tensors in Jupyter notebook due to loading errors
See original GitHub issueDescribe the bug
I’m currently trying to use the Jupyter kernel with ML.NET and the OnnxRuntime to prototype model inference based on pre-computed onnx models. However I am unable to use System.Numerics.Tensors to create inputs to the model:
(EDIT - updated to minimal repro)
#r "nuget:Microsoft.ML.OnnxRuntime,1.1.0"
using System.Numerics.Tensors;
var inputValues = new[]{12f, 10f, 17f, 5f};
var tInput = new DenseTensor<float>(inputValues.AsMemory(), new ReadOnlySpan<int>(new[]{4}));
errors with:
Unhandled Exception
Could not load file or assembly 'System.Numerics.Tensors, Version=0.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
at Submission#23.<<Initialize>>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Submission#23.<Initialize>()
at Submission#23.<Factory>(Object[] submissionArray)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
This apperently tries to load a reference assembly into the runtime. /cc @eerhardt
Did this error occur while using dotnet try
or online?
-
dotnet-try
- .NET Jupyter Notebook
- online
What kind of error was it?
- User Interface (UI): For example the output never displayed
- Service Error: For example “The service is temporarily unavailable. We are working on it”
- Other:
Screenshots
Please complete the following:
- OS
- Windows 10
- macOS
- Linux (Please specify distro)
- iOS
- Android
- Browser
- Chrome
- Edge (Dev Channel)
- Safari
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Unable to use Tensors in Jupyter notebook due to loading ...
I'm currently trying to use the Jupyter kernel with ML.NET and the OnnxRuntime to prototype model inference based on pre-computed onnx models.
Read more >Trying to import Tensor flow in my jupyter notebook but ...
Create a New Virtual Environment in Anaconda and Try installing the Latest Version of Tensorflow . Steps are mentioned below:
Read more >How to Fix Pytorch Module Errors in Jupyter Notebook
1. ModuleNotFoundError. The ModuleNotFoundError is a common error that occurs when Pytorch is unable to locate a module that is required for the ......
Read more >Using TensorBoard in Notebooks
Start by installing TF 2.0 and loading the TensorBoard notebook extension: For Jupyter users: If you've installed Jupyter and TensorBoard ...
Read more >What to do when you get an error
Feel free to test it out :) and the first thing you think of is to load the model using the pipeline from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dasMulli , hey mate, I’m using this issue to track the code-change. So I would like to keep this open for now, if that is good with you 😃
There’ll be a more general announcement soon.