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

Error: GetTensorMutableData should not be a null pointer #185

Closed
jamjamjon opened this issue Apr 11, 2024 · 1 comment
Closed

Error: GetTensorMutableData should not be a null pointer #185

jamjamjon opened this issue Apr 11, 2024 · 1 comment

Comments

@jamjamjon
Copy link

jamjamjon commented Apr 11, 2024

Problem

Error: GetTensorMutableData should not be a null pointer

This onnx model has 4 outputs. When fetch the "batchno_classid_y1x1y2x2" output, error occurs.
image

Version

version = "2.0.0-alpha.4"

Model

https://github.com/jamjamjon/assets/releases/download/v0.0.1/yolopv2_dyn-480x800-f16.onnx

Code

 
        let ys = self.session.run(xs_.as_ref())?;

        // oputput
        let mut ys_ = Vec::new();


        for (dtype, name) in self.odtypes.iter().zip(self.onames.iter()) {
            let y = &ys[name.as_str()];
 
            let y_ = match &dtype {
                TensorElementType::Float32 => {
                    y.extract_tensor::<f32>()?.view().to_owned()
                },
                TensorElementType::Float16 => {
                    y.extract_tensor::<f16>()?.view().mapv(f16::to_f32)
                },
                TensorElementType::Int64 => {
                    y.extract_tensor::<i64>()?.view().to_owned().mapv(|x| x as f32)
                } 
                _ => todo!(),
            };
            ys_.push(y_);
        }
@decahedron1
Copy link
Member

I'd imagine this just happens when there's no detections (N is 0). In that case (with ort v2.0.0-rc.1) just check .shape() first and make sure N is > 0 before trying to extract.

let t = ys["batchno_classid_y1x1y2x2"].upcast_ref::<Tensor<i64>>()?;
let n_detections = t.shape()?[0];
if n_detections > 0 {
    ...
}

kallebysantos added a commit to kallebysantos/edge-runtime that referenced this issue Oct 1, 2024
- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185
kallebysantos added a commit to kallebysantos/edge-runtime that referenced this issue Oct 31, 2024
- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185
kallebysantos added a commit to kallebysantos/edge-runtime that referenced this issue Nov 2, 2024
- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185
kallebysantos added a commit to kallebysantos/edge-runtime that referenced this issue Nov 5, 2024
- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185
kallebysantos added a commit to kallebysantos/edge-runtime that referenced this issue Nov 11, 2024
- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185
laktek pushed a commit to supabase/edge-runtime that referenced this issue Nov 12, 2024
* feat: integrate `trasnformers.js` with rust backend

Simple integration between `transformers.js` and rust ort backend by
exposing js owned API

* stamp: refactoring tensors ser/de to try zero-copy

- Implementing v8 traits to cast tensors `ToV8` and `FromV8`.
- Resolving `ort::Tensor` type based on Js tensor's.

* stamp: refactoring to use `serde_v8`

- Since `serde_v8` allows zero-copy we use it to handle the model
inputs and send back the outputs

* fix(ai): seq2seq models causing null pointer error

- Solved the "`GetMutableData` should not be a null pointer" error while
executing seq2seq models.
- Ref.: pykeio/ort#185

* test(sb_ai): implementing tests for ort backend

- Applying integration tests over all NLP pipelines with ort backend

* stamp(sb_ai): example for generate image embeddings

* test(sb_ai): implementing computer vision tests for ort backend

- Applying integration tests over VISION pipelines with ort backend

* stamp: clippy

* fix(ci): makes share common env vars from dotenv file

* fix(ci): update `ORT_DYLIB_PATH`

* fix(ci): makes share common env vars from dotenv file

* chore(sb_ai): update dependencies

* chore(event_worker): add a dependency

* chore(event_worker): install a tracing macro

* chore(base): update `Cargo.toml`

* chore(base): trace `malloced_mb` more precisely

* chore: update an integration test case script

* chore: install tracing subscriber when `base/tracing` feature is enabled

* chore: update `Cargo.lock`

* stamp: add `docker build` script with shared envs

* fix(devcontainer): shared `.env` file path

---------

Co-authored-by: Nyannyacha <meow@nnc.gg>
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

2 participants