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

Implement a proper batch inference for the depth estimator #131

Open
integraledelebesgue opened this issue Jan 25, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@integraledelebesgue
Copy link
Member

The obvious implementation

    def predict_batch(
        self,
        frames: list[Frame],
        properties: Properties,
    ) -> list[FloatArray2]:
        return [self.predict(frame, properties) for frame in frames]

        input = torch.stack([torch.from_numpy(frame) for frame in frames])
        input = input.to(self.device)
        input = torch.permute(input, (0, 3, 1, 2))
        input = self.to_model(input)

        result = self.model.predict(input)
        depth: FloatArray3 = (
            Resize((properties.height, properties.width))  # type: ignore[no-untyped-call]
            .forward(result.depth)
            .to(torch.float32)
            .mul(1000.0)
            .cpu()
            .numpy()
        )
        del result

        return list(depth)

results in the error:

RuntimeError: NVML_SUCCESS == DriverAPI::get()->nvmlInit_v2_() INTERNAL ASSERT FAILED at "../c10/cuda/CUDACachingAllocator.cpp":963, please report a bug to PyTorch.
@integraledelebesgue integraledelebesgue converted this from a draft issue Jan 25, 2025
@integraledelebesgue integraledelebesgue added the bug Something isn't working label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant