Code Monkey home page Code Monkey logo

Comments (10)

jantonguirao avatar jantonguirao commented on July 23, 2024 1

If this is a question to install numpy in the environment of the DALI backend, then I think that it'd be a good idea for convenience. My original comment was about adding numpy as a dependency to DALI, which would not make sense.

from dali_backend.

fran6co avatar fran6co commented on July 23, 2024

There are several examples in the dali documentation where it uses numpy in them, the backend should support it

from dali_backend.

jantonguirao avatar jantonguirao commented on July 23, 2024

In those examples, numpy is used to produce some kind of data to be used together with the DALI pipeline. However, DALI doesn't need numpy to work and therefore, adding it to its dependencies would be in my opinion wrong.

from dali_backend.

fran6co avatar fran6co commented on July 23, 2024

What if you need to build a transformation matrix just like I'm showing in the example code? That's a very normal thing to do and I don't see the downside of adding numpy to the env

from dali_backend.

JanuszL avatar JanuszL commented on July 23, 2024

Hi @fran6co,

I'm sorry to disagree. We want to enforce as less dependencies over DALI as possible.
If we want to add all packages that DALI can cooperate with we would need to add a dependency to Torch and CuPy as DALI can use tensors from these frameworks.

from dali_backend.

fran6co avatar fran6co commented on July 23, 2024

I don't agree about that this is equivalent to CuPy or Torch. I created this issue not as just "DALI supports X then this backend should as well" but with a specific use case. Can you advice how would you solve it without numpy?

from dali_backend.

jantonguirao avatar jantonguirao commented on July 23, 2024

@fran6co

Can you advice how would you solve it without numpy?

Yes. You can achieve that like this:

identity_mat = fn.constant(shape=(3, 3), fdata=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], dtype=types.FLOAT, device="cpu")

from dali_backend.

fran6co avatar fran6co commented on July 23, 2024

@jantonguirao thanks, I will try that

from dali_backend.

fran6co avatar fran6co commented on July 23, 2024

I agree, the PR is to add numpy to the backend unless I added it to the wrong place

from dali_backend.

szalpal avatar szalpal commented on July 23, 2024

The original issue here was to create an auxiliary matrix using numpy. @fran6co proposed to extend DALI Backend dependencies with numpy. However, there is a solution to this issue without the need of introducing an extra dependency and therefore is preferable. Thus I'll close this issue.

Nevertheless, the question of adding more dependencies to DALI Backend is still a valid one. On one hand, there certainly are use cases, where such dependency would make development the inference solution way easier. On the other, such approach looks like a gift that will keep giving: there will always be an extra dependency to add. For the latter reason I believe that adding those in a way presented in #143 is not the wanted solution (although numpy is so popular, that we may end up with this). Instead, I believe there should be an easy-ish way to add any particular dependency to the deployed tritonserver image. We'll put this to our backlog and we'll design something proper.

from dali_backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.