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

terminate called after throwing an instance of 'std::length_error' what(): vector::_M_fill_insert Aborted (core dumped) #115

Open
yaatsn3821 opened this issue Feb 20, 2022 · 0 comments

Comments

@yaatsn3821
Copy link

yaatsn3821 commented Feb 20, 2022

First of all, thanks a lot for packaging this!
I tried this code.

import numpy as np
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_softmax, create_pairwise_bilateral

probs = np.random.rand((0,1),30000,30000)
probs = np.tile(probs[np.newaxis,:,:],(2,1,1))
probs[1,:,:] = 1 - probs[0,:,:]
U = unary_from_softmax(probs) 
img = np.zeros((30000,30000), np.uint8)
pairwise_energy = create_pairwise_bilateral(sdims=(10,10), schan=(0.01,), img=img, chdim=-1)
d = dcrf.DenseCRF2D(30000, 30000, 2)
d.setUnaryEnergy(U)
d.addPairwiseEnergy(pairwise_energy, compat=10)

but, got below error.

terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_fill_insert
Aborted (core dumped)

This is probably because img size is very large.Retried with about 10000x10000,it's no error.
But, 30000x30000 size image need to be processed.
Dividing image is the best solution?
Could some one help me?

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

1 participant