ranahanocka / MeshCNN

Convolutional Neural Network for 3D meshes in PyTorch
MIT License
1.61k stars 320 forks source link

Issue with shrec datasets #30

Closed ankitpatnala closed 5 years ago

ankitpatnala commented 5 years ago

Traceback (most recent call last): File "train.py", line 23, in for i, data in enumerate(dataset): File "/home/ankit/MeshCNN/data/init.py", line 33, in iter for i, data in enumerate(self.dataloader): File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in next return self._process_next_batch(batch) File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch raise batch.exc_type(batch.exc_msg) ValueError: Traceback (most recent call last): File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/ankit/MeshCNN/data/classification_data.py", line 31, in getitem edge_features = pad(edge_features, self.opt.ninput_edges) File "/home/ankit/MeshCNN/util/util.py", line 22, in pad return np.pad(input_arr, pad_width=npad, mode='constant', constant_values=val) File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/numpy/lib/arraypad.py", line 1200, in pad pad_width = _validate_lengths(narray, pad_width) File "/home/ankit/anaconda3/envs/meshcnn/lib/python3.6/site-packages/numpy/lib/arraypad.py", line 985, in _validate_lengths raise ValueError(fmt % (number_elements,)) ValueError: [(0, 0), (0, -150)] cannot contain negative values.

"" Do i need to change any base options to counter this error ? ""

ranahanocka commented 5 years ago

Hi @ankitpatnala ,

I am on vacation without access to a laptop, so I cannot try to reproduce this issue at the moment. Which version of pytorch are you using? I can say with 100% certainty the code worked on the CPU before I made the change to pytorch 1.2. Its possible I may not have checked CPU since then.

In any case, you can roll back to using the old code (i.e., run git checkout cf93099bb1de4b5fbd9c18e6241af298b839af06) which will print a lot of warnings with the newest pytorch , or use an older version (i.e., pytorch 1.0) which should have no errors or warning prints.

Let me know. I'll check back in about a week or so.

ankitpatnala commented 5 years ago

@ranahanocka I see, I was using a pytorch version of 1.0 as i created environment from environment.yml file . Anyway i will try with new pytorch or with old checkout

ranahanocka commented 5 years ago

I see. I will update the environment.yml file. In that case, use the old checkout with the old pytorch (which you are already using). That will definitely work.

ankitpatnala commented 5 years ago

Thanks a lot. It worked.