pvnieo / SURFMNet-pytorch

A pytorch implementation of: "Unsupervised Deep Learning for Structured Shape Matching"
MIT License
16 stars 2 forks source link

Error with different number of vertices #1

Closed ihmc3jn09hk closed 3 years ago

ihmc3jn09hk commented 3 years ago

When testing with the remesh set (MAT_SHOT), the program failed with

Original Traceback (most recent call last):
  File "...\Python383\lib\site-packages\torch\utils\data\_utils\worker.py", line 198, in _worker_loop
    data = fetcher.fetch(index)
  File "...\Python383\lib\site-packages\torch\utils\data\_utils\fetch.py", line 47, in fetch
    return self.collate_fn(data)
  File "...\Python383\lib\site-packages\torch\utils\data\_utils\collate.py", line 83, in default_collate
    return [default_collate(samples) for samples in transposed]
  File "...\Python383\lib\site-packages\torch\utils\data\_utils\collate.py", line 83, in <listcomp>
    return [default_collate(samples) for samples in transposed]
  File "...\Python383\lib\site-packages\torch\utils\data\_utils\collate.py", line 55, in default_collate
    return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [5001, 352] at entry 0 and [5000, 352] at entry 1

All parameters for train.py used are default.

Moreover, could the evaluation/inferernce code be provided ?

pvnieo commented 3 years ago

Hi, Sorry for the late replay, the error is simple, but it will take me time to fix it.

Can you try with a batch_size=1?

ihmc3jn09hk commented 3 years ago

Hi, Sorry for the late replay, the error is simple, but it will take me time to fix it.

Can you try with a batch_size=1?

Hi, I tried following

python3 train.py -bs 1 --n-epochs 2 -d data/Faust_remesh/

which gives

Traceback (most recent call last):
  File "train.py", line 89, in <module>
    train_fmnet(args)
  File "train.py", line 37, in train_fmnet
    feat_x, feat_y = feat_x[:, vertices, :].to(device), feat_y[:, vertices, :].to(device)
IndexError: index 5002 is out of bounds for dimension 0 with size 5002

The data in Faust_remesh is downloaded by running the provided download_data.sh.

pvnieo commented 3 years ago

fixed! Thanks for your remark!