pvnieo / GeomFmaps_pytorch

A minimalist pytorch implementation of: "Deep Geometric Functional Maps: Robust Feature Learning for Shape Correspondence"
MIT License
24 stars 2 forks source link

Got errors in dataloader #5

Closed puhuajiang closed 2 years ago

puhuajiang commented 2 years ago

Hi, thank you for your work about this pytorch version of GeomFmaps.

When I run train.py, I got this error "TypeError: expected Tensor as element 1 in argument 0, but got NoneType". It seems that when the dataloader trys to change that input data to Mutilscale data the error comes out.

And the whole output is:

{'dataroot': '/home/puhua/GeomFmaps_pytorch-master/FAUST_r', 'neig': 30, 'n_train': 3, 'max_train': 5, 'pre_transforms': [{'transform': 'GridSampling3D', 'params': {'size': 0.02}}], 'train_transforms': [{'transform': 'Random3AxisRotation', 'params': {'apply_rotation': True, 'rot_x': 0, 'rot_y': 360, 'rot_z': 0}}, {'transform': 'RandomNoise', 'params': {'sigma': 0.01, 'clip': 0.05}}, {'transform': 'RandomScaleAnisotropic', 'params': {'scales': [0.9, 1.1]}}, {'transform': 'AddOnes'}, {'transform': 'AddFeatsByKeys', 'params': {'list_add_to_x': [True], 'feat_names': ['ones'], 'delete_feats': [True]}}], 'test_transforms': [{'transform': 'AddOnes'}, {'transform': 'AddFeatsByKeys', 'params': {'list_add_to_x': [True], 'feat_names': ['ones'], 'deletefeats': [True]}}], 'lambda': 0.001, 'in_grid_size': 0.02, 'n_feat': 128, 'no_cuda': False, 'batch_size': 2, 'n_cpu': 1, 'n_epochs': 20, 'lr': 0.001, 'checkpoint_interval': 5, 'log_interval': 20, 'savedir': '/home/puhua/GeomFmaps_pytorch-master/savedir/', 'evaldir': '/home/puhua/GeomFmaps_pytorch-master/evaldir/'} Compose([ GridSampling3D(grid_size=0.02, quantize_coords=False, mode=mean), ]) Using: ['000', '001', '002'] Loading evecs: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 11.20it/s] Loading vts: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 65.58it/s] Data(evals_x=[90], evecs_trans_x=[7178, 30], evecs_x=[7178, 30], grid_size=[3], id_scan=[3], nv=[3], origin_id=[7178], pos=[7178, 3]) PARTIAL_DENSE (Data(C_gt=[1, 30, 30], evals_x=[30], evecs_trans_x=[2396, 30], evecs_x=[2396, 30], grid_size=[1], id_scan=[1], nv=[1], origin_id=[2396], pos=[2396, 3], x=[2396, 1]), Data(evals_x=[30], evecs_trans_x=[2414, 30], evecs_x=[2414, 30], grid_size=[1], id_scan=[1], nv=[1], origin_id=[2414], pos=[2414, 3], x=[2414, 1])) Traceback (most recent call last): File "train.py", line 61, in train(params) File "train.py", line 36, in train for i, batch in enumerate(trainloader): File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next data = self._next_data() File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data return self._process_data(data) File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data data.reraise() File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop data = fetcher.fetch(index) File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/puhua/GeomFmaps_pytorch-master/geomfmaps/shape_matching_dataset.py", line 304, in return lambda datalist: MultiScaleBatch.from_data_list([y for x in datalist for y in x]) File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch_points3d/datasets/multiscale_data.py", line 96, in from_data_list batch = Batch.from_data_list(data_list) File "/home/puhua/miniconda3/envs/py37torch18/lib/python3.7/site-packages/torch_geometric/data/batch.py", line 156, in from_data_list batch[key] = torch.cat(items, cat_dim) TypeError: expected Tensor as element 1 in argument 0, but got NoneType

And I output some infomation about the dataset. Can you help me with this error? Thank you for your help!

My envirorment: Python 3.7 Pytorch 1.8 CUDA 10.1 torch-geometric 1.7.2 torch-points-kernels 0.6.10 torch-points3d 1.3.0

pvnieo commented 2 years ago

Hi @puhuajiang

Thank you for your interest.

Actually, this is not the official implementation and is not maintained anymore.

I suggest that you take a look at the DiffusionNet or DPFM implementations, as they are more recent and give better results.

Best,