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

A bug with torch #4

Closed
akira2025 opened this issue Jun 22, 2021 · 3 comments
Closed

A bug with torch #4

akira2025 opened this issue Jun 22, 2021 · 3 comments

Comments

@akira2025
Copy link

Hi guys, I have a bug when running your code. when I run in Registration part. I have a problem below.
I also try with my machine but also have same problem. I hope you can give me some suggestion.
Thank you so much


OSError Traceback (most recent call last)

in ()
6 import requests
7 import torch
----> 8 from torch_points3d.applications.pretrained_api import PretainedRegistry
9 from torch_points3d.core.data_transform import GridSampling3D, AddFeatByKey, AddOnes, Random3AxisRotation
10 from torch_points3d.datasets.registration.pair import Pair

8 frames

/usr/local/lib/python3.7/dist-packages/torch_points3d/applications/pretrained_api.py in ()
5
6 # Import building function for model and dataset
----> 7 from torch_points3d.datasets.dataset_factory import instantiate_dataset
8 from torch_points3d.models.model_factory import instantiate_model
9

/usr/local/lib/python3.7/dist-packages/torch_points3d/datasets/dataset_factory.py in ()
4 import logging
5
----> 6 from torch_points3d.datasets.base_dataset import BaseDataset
7
8 log = logging.getLogger(name)

/usr/local/lib/python3.7/dist-packages/torch_points3d/datasets/base_dataset.py in ()
6 import numpy as np
7 import torch
----> 8 import torch_geometric
9 from torch_geometric.transforms import Compose, FixedPoints
10 import copy

/usr/local/lib/python3.7/dist-packages/torch_geometric/init.py in ()
3
4 from .debug import is_debug_enabled, debug, set_debug
----> 5 import torch_geometric.data
6 import torch_geometric.transforms
7 import torch_geometric.utils

/usr/local/lib/python3.7/dist-packages/torch_geometric/data/init.py in ()
----> 1 from .data import Data
2 from .temporal import TemporalData
3 from .batch import Batch
4 from .dataset import Dataset
5 from .in_memory_dataset import InMemoryDataset

/usr/local/lib/python3.7/dist-packages/torch_geometric/data/data.py in ()
6 import torch
7 import torch_geometric
----> 8 from torch_sparse import coalesce, SparseTensor
9 from torch_geometric.utils import (contains_isolated_nodes,
10 contains_self_loops, is_undirected)

/usr/local/lib/python3.7/dist-packages/torch_sparse/init.py in ()
13 ]:
14 torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
---> 15 f'{library}_{suffix}', [osp.dirname(file)]).origin)
16
17 if torch.cuda.is_available(): # pragma: no cover

/usr/local/lib/python3.7/dist-packages/torch/_ops.py in load_library(self, path)
102 # static (global) initialization code in order to register custom
103 # operators with the JIT.
--> 104 ctypes.CDLL(path)
105 self.loaded_libraries.add(path)
106

/usr/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error)
362
363 if handle is None:
--> 364 self._handle = _dlopen(self._name, mode)
365 else:
366 self._handle = handle

OSError: /usr/local/lib/python3.7/dist-packages/torch_sparse/_convert_cuda.so: undefined symbol: _ZNK2at6Tensor6deviceEv

@humanpose1
Copy link
Owner

Hi @akira2025 ,

The bug with torch is solved! The problem was that the version of torch-sparse and torch were incompatible.
But now there is a new bug with torchsparse. I opened an issue in there repo.
Regards,

@trinhnhut-gif
Copy link

hi humanposes1
I also have a bug when testing today. I think the problem is torchsparse in new_coor line
I am using torch 1.8.1+cuda 10.2
Thank you.


IndexError Traceback (most recent call last)

in ()
4 with torch.no_grad():
5 model.set_input(data_s, "cuda")
----> 6 feat_s = model.forward()
7 model.set_input(data_t, "cuda")
8 feat_t = model.forward()

12 frames

/usr/local/lib/python3.7/dist-packages/torch_points3d/models/registration/ms_svconv3d.py in forward(self, *args, **kwargs)
252
253 def forward(self, *args, **kwargs):
--> 254 self.output, outputs = self.apply_nn(self.input)
255 if self.match is None:
256 return self.output

/usr/local/lib/python3.7/dist-packages/torch_points3d/models/registration/ms_svconv3d.py in apply_nn(self, input)
242 for i in range(len(self.grid_size)):
243 self.unet.set_grid_size(self.grid_size[i])
--> 244 out = self.unet(input.clone())
245 out.x = out.x / (torch.norm(out.x, p=2, dim=1, keepdim=True) + 1e-20)
246 outputs.append(out)

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/torch_points3d/models/registration/ms_svconv3d.py in forward(self, data, **kwargs)
82 d, cluster = self._prepare_data(inp)
83 d.x = self.pre_mlp(d.x)
---> 84 d = self.unet.forward(d)
85 inp_post_mlp = d.x[cluster]
86 if self.add_pos:

/usr/local/lib/python3.7/dist-packages/torch_points3d/applications/sparseconv3d.py in forward(self, data, *args, **kwargs)
196 stack_down = []
197 for i in range(len(self.down_modules) - 1):
--> 198 data = self.down_modulesi
199 stack_down.append(data)
200

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/torch_points3d/modules/SparseConv3d/modules.py in forward(self, x)
137
138 def forward(self, x):
--> 139 out = self.conv_in(x)
140 if self.blocks:
141 out = self.blocks(out)

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py in forward(self, input)
117 def forward(self, input):
118 for module in self:
--> 119 input = module(input)
120 return input
121

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

/usr/local/lib/python3.7/dist-packages/torch_points3d/core/data_transform/../../../torchsparse/nn/modules/conv.py in forward(self, inputs)
86 stride=self.stride,
87 dilation=self.dilation,
---> 88 transpose=self.t)
89
90

/usr/local/lib/python3.7/dist-packages/torch_points3d/core/data_transform/../../../torchsparse/nn/functional/conv.py in conv3d(inputs, kernel, kernel_size, bias, stride, dilation, transpose)
131 kOffset = kRegion.get_kernel_offset().to(features.device)
132 new_coords = spF.spdownsample(coords, stride, kernel_size,
--> 133 cur_stride)
134 hash_query = spF.sphash(new_coords, kOffset)
135 hash_target = spF.sphash(coords)

/usr/local/lib/python3.7/dist-packages/torch_points3d/core/data_transform/../../../torchsparse/nn/functional/downsample.py in spdownsample(coords, ratio, kernel_size, tensor_stride)
67 # filter out duplicates
68 new_coords = torch.unique(new_coords, dim=0)
---> 69 new_coords = new_coords[:, [1, 2, 3, 0]]
70 return new_coords

IndexError: too many indices for tensor of dimension 1

@humanpose1
Copy link
Owner

humanpose1 commented Jun 24, 2021

Sorry for the trouble. Now I've fixed the problem, Actually I've downgraded the version of torchsparse.

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

3 participants