You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the unet to extract features (B, N, 32) from point clouds (B, N, 3). When I changed resolution from 50 to 24, the segment fault was thrown. This is not due to too low resolution, because it also threw segment fault in other data when I set resolution to 100. My Code snippet is shown below.
defscn_input_wrapper(tensor_list: Iterable[torch.Tensor], scale:float, bias:float, device=None):
D=tensor_list[0].shape[-1]
device=deviceifdeviceisnotNoneelsetensor_list[0].devicecoord_params=dict(dtype=torch.int64, device=device)
feature_params=dict(dtype=torch.float32, device=device)
C=torch.empty([0,D+1], **coord_params) # (N, D+1) last dim for batch_idxF=torch.empty([0,1], **feature_params) # (N,1) 1-dim feature for each pointforb, tensorinenumerate(tensor_list):
coords=torch.hstack([((tensor+bias)*scale).to(**coord_params), b*torch.ones([tensor.shape[0],1],**coord_params)])
features=torch.ones([tensor.shape[0],1],**feature_params)
C=torch.vstack([C,coords])
F=torch.vstack([F,features])
return [C, F]
defscn_output_wrapper(tensor:torch.Tensor, batch_idx:torch.Tensor, batch_size:int):
batch=torch.zeros(batch_size, tensor.shape[0] //batch_size, tensor.shape[1], dtype=tensor.dtype, device=tensor.device)
forbiinrange(batch_size):
bi_indices=batch_idx==bibatch[bi, ...] =tensor[bi_indices,:]
returnbatch
Please download our data and unzip debug_pc1.npy and debug_pc2.npy and run the Main program. debug_pc.zip
Main
pc1=np.load('debug_pc1.npy')
pc2=np.load('debug_pc2.npy')
scnet=SCNet()
# scnet.load_state_dict(torch.load("pretrained/scn.pth",map_location='cpu')) # here weights do not affect the resultsscnet.eval()
scnet.cuda()
resolution=24# segment fault. But no fault emerged if resolution = 50sinput1=scn_input_wrapper([torch.from_numpy(pc1).cuda()],resolution,0)
sinput2=scn_input_wrapper([torch.from_numpy(pc2).cuda()],resolution,0)
print("start scn forward") # segment fault is thrown right after this linefeat1=scnet.unet_foward(sinput1).detach().cpu().numpy()
feat2=scnet.unet_foward(sinput2).detach().cpu().numpy()
print("Feature extraction Finished.")
I annotate the segment fault in the above code snippet.
Thanks for your reply.
The text was updated successfully, but these errors were encountered:
I use the unet to extract features (B, N, 32) from point clouds (B, N, 3). When I changed
resolution
from 50 to 24, the segment fault was thrown. This is not due to too low resolution, because it also threw segment fault in other data when I setresolution
to 100. My Code snippet is shown below.UNet
DataProcessing
Please download our data and unzip
debug_pc1.npy
anddebug_pc2.npy
and run theMain
program.debug_pc.zip
Main
I annotate the segment fault in the above code snippet.
Thanks for your reply.
The text was updated successfully, but these errors were encountered: