facebookresearch / ContrastiveSceneContexts

Code for CVPR 2021 oral paper "Exploring Data-Efficient 3D Scene Understanding with Contrastive Scene Contexts"
MIT License
218 stars 29 forks source link

Semseg on S3DIS with sigle GPU #15

Closed sjtuchenye closed 2 years ago

sjtuchenye commented 2 years ago

I try to run './scripts/train_stanford3d.sh' and modify the config to single gpu, without changes to other code. I do not know why I get such error?

Traceback (most recent call last): File "ddp_main.py", line 232, in cli_main main(config) File "ddp_main.py", line 187, in main train(model, train_data_loader, val_data_loader, config) File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/train.py", line 107, in train coords, input, target = data_iter.next() File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/_utils.py", line 395, in reraise raise self.exc_type(msg) AttributeError: Caught AttributeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/dataset.py", line 277, in getitem coords, feats, labels, center = self.load_ply(index) File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/dataset.py", line 71, in wrapper results = func(self, *args, **kwargs) File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/datasets/stanford.py", line 158, in load_ply plydata = PlyData.read(filepath) File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/plyfile.py", line 287, in read data = PlyData._parse_header(stream) File "/data1/ljx/anaconda3/envs/PointContrast/lib/python3.7/site-packages/plyfile.py", line 229, in _parse_header line = stream.readline().decode('ascii').strip() AttributeError: 'PosixPath' object has no attribute 'readline'

Sekunde commented 2 years ago

File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/datasets/stanford.py", line 158, in load_ply plydata = PlyData.read(filepath)

it seems to me that the ply file can not be found. Can you print the filepath to see if the file is really there?

RozDavid commented 2 years ago

Hey @sjtuchenye,

Assume I am a bit late here, but might be helpful for somebody in the future. "PosixPath" related errors can happen, when your torch version is older than the one the file was generated.

I solved this problem by upgrading torch to 1.7.0, but I think anything after 1.5.x should also work.

sjtuchenye commented 2 years ago

Hey @sjtuchenye,

Assume I am a bit late here, but might be helpful for somebody in the future. "PosixPath" related errors can happen, when your torch version is older than the one the file was generated.

I solved this problem by upgrading torch to 1.7.0, but I think anything after 1.5.x should also work.

Thank you so much, it works.

sjtuchenye commented 2 years ago

File "/data1/ljx/CY/PointContrast/downstream/semseg/lib/datasets/stanford.py", line 158, in load_ply plydata = PlyData.read(filepath)

it seems to me that the ply file can not be found. Can you print the filepath to see if the file is really there?

The filepath does exist. The issue is the version of torch. Thank you and I have solved it.