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

RuntimeError: non-empty 3D or 4D (batch mode) tensor expected for input #28

Open
GitSwar90 opened this issue Aug 25, 2020 · 0 comments
Open

Comments

@GitSwar90
Copy link

GitSwar90 commented Aug 25, 2020

from convcrf import convcrf

config = convcrf.default_conf
shape = [3,416,416]
nclasses = 15

crf = convcrf.GaussCRF(config, shape, nclasses)
crf.cuda()

img = torch.randn(1,3,416,416).cuda()
un = torch.randn(1,15,416,416).cuda()
un = torch.softmax(un,dim=1)

pred = crf.forward(un, img)

ERROR:
Traceback (most recent call last):

File "", line 1, in
pred = crf.forward(un, img)

File "...\anaconda3\lib\site-packages\convcrf-1.0-py3.7.egg\convcrf\convcrf.py", line 202, in forward
compats, conf['merge'])

File "...\anaconda3\lib\site-packages\convcrf-1.0-py3.7.egg\convcrf\convcrf.py", line 574, in add_pairwise_energies
pyinn=self.pyinn)

File "...\anaconda3\lib\site-packages\convcrf-1.0-py3.7.egg\convcrf\convcrf.py", line 311, in init
gaussian = self._create_convolutional_filters(feats)

File "...\anaconda3\lib\site-packages\convcrf-1.0-py3.7.egg\convcrf\convcrf.py", line 353, in _create_convolutional_filters
count_include_pad=False)

RuntimeError: non-empty 3D or 4D (batch mode) tensor expected for input

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