Giter Club home page Giter Club logo

Comments (6)

Maqingyang avatar Maqingyang commented on August 26, 2024

It seems that high cpu occupacy lies in the dataloader, because if I use a constant input_batch instead of dataloader, it won't occupy so much cpu.

image

input_batch.json contains one pre-stored batch from dataloader.

from graphcmr.

nkolot avatar nkolot commented on August 26, 2024

Maxing out the CPU in general is a good thing, because it means that the input pipeline is efficient. You can reduce the num_workers option to use less processes if this is an issue on your system. But consequently this will reduce the training speed.

from graphcmr.

Maqingyang avatar Maqingyang commented on August 26, 2024

Thanks for your advice. I am carefully looking for the cpu exhaustive operation. I found that the crop() in imutils.py is very cpu exhaustive. In fact, if I did't use crop in base_dataset.py, the cpu occupacy will drop to 1/4 as before! That's very strange. I am checking more on that. I don't know what about on your machine.

from graphcmr.

Maqingyang avatar Maqingyang commented on August 26, 2024

I located the problem in the imutils.py.
In func transfrom():

    if invert:
        t = np.linalg.inv(t)

This inverse operation is very cpu exhaustive. Could this operation be avoided? Or move this operation to be computed on gpu?

from graphcmr.

Maqingyang avatar Maqingyang commented on August 26, 2024

I found a simple solution, which is magically effective.

    if invert:
        # t = np.linalg.inv(t)
        t_torch = torch.from_numpy(t)
        t_torch = torch.inverse(t_torch)
        t = t_torch.numpy()

If anyone have the same problem, maybe can have a try.

from graphcmr.

nkolot avatar nkolot commented on August 26, 2024

I will look into it. Ii'm surprised that numpy is so slow in this simple task of inverting a 4x4 matrix.

from graphcmr.

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.