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

Run error #77

Closed
liusheng0620 opened this issue Aug 15, 2021 · 1 comment
Closed

Run error #77

liusheng0620 opened this issue Aug 15, 2021 · 1 comment

Comments

@liusheng0620
Copy link

liusheng0620 commented Aug 15, 2021

When I randomly generate a tensor, It's OK. But when I input a picture, it will report an error. How can I solve it?
Code:
d = 3
generate a tensor
input = torch.randn(2,2,2,2)
input a picture
input = Image.open('/data/lu/ls/data/BDDU/ShadowImages/04056725-14e1b11d-00001.png' ).convert('RGB')
input = torch.from_numpy(np.array(input)).unsqueeze(0).permute(0,3,2,1)
out = spatial_correlation_sample(input, input, kernel_size=d, patch_size=d, stride=1, padding=int(d/2))

Error:
terminate called after throwing an instance of 'c10::Error'
what(): "correlation_forward_cpp" not implemented for 'Byte' (operator() at Correlation_Module/correlation.cpp:119)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7fb1fe957687 in /home/amax/anaconda3/envs/py36tor131/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: + 0x35fc3 (0x7fb1fdc76fc3 in /home/amax/anaconda3/envs/py36tor131/lib/python3.6/site-packages/spatial_correlation_sampler-0.3.0-py3.6-linux-x86_64.egg/spatial_correlation_sampler_backend.cpython-36m-x86_64-linux-gnu.so)
frame #2: + 0x1465f (0x7fb1fe48665f in /home/amax/anaconda3/envs/py36tor131/lib/python3.6/site-packages/torch/lib/../../../../libgomp.so.1)
frame #3: + 0x76ba (0x7fb20311f6ba in /lib/x86_64-linux-gnu/libpthread.so.0)
frame #4: clone + 0x6d (0x7fb202e5551d in /lib/x86_64-linux-gnu/libc.so.6)

terminate called recursively
已放弃

@ClementPinard
Copy link
Owner

Are you sure your image is converted to float ? Looks like you are trying to run the correlation on uint8 tensors, which might not be available.

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

2 participants