Open3D-ML icon indicating copy to clipboard operation
Open3D-ML copied to clipboard

'S3DISSplit' object has no attribute 'sampler'

Open Katherine2013 opened this issue 5 years ago • 12 comments

Hi! Thank you for your amazing job. I wanted to see S3DIS results on RandLA-Net model. I've followed the instructions step by step at homepage. Now sth went wrong when I perform pipeline.run_test() for the pre-trained model.

test 0/1: 100%|██████████| 87306/87306 [00:36<00:00, 1148.52it/s]INFO - 2021-01-14 06:39:25,229 - semantic_segmentation - DEVICE : cpu INFO - 2021-01-14 06:39:25,231 - semantic_segmentation - Logging in file : ./logs/RandLANet_S3DIS_torch/log_test_2021-01-14_06:39:25.txt INFO - 2021-01-14 06:39:25,233 - s3dis - Found 23 pointclouds for test

AttributeError Traceback (most recent call last) in () 34 35 # evaluate performance on the test set; this will write logs to './logs'. ---> 36 pipeline.run_test()

/usr/local/lib/python3.6/dist-packages/open3d/_ml3d/torch/pipelines/semantic_segmentation.py in run_test(self) 201 202 test_dataset = dataset.get_split('test') --> 203 test_sampler = test_dataset.sampler 204 test_split = TorchDataloader(dataset=test_dataset, 205 preprocess=model.preprocess,

AttributeError: 'S3DISSplit' object has no attribute 'sampler'

Why it said no attribute sampler? It seems the data has already been loaded. Thanks in advance.

Katherine2013 avatar Jan 14 '21 06:01 Katherine2013

@Katherine2013 PR #226 should fix this issue. Feel free to close this issue after testing it.

sanskar107 avatar Feb 19 '21 12:02 sanskar107

Hi Have you fixed this issue? I met the same problem when I tried to train a model use RandLA on Semantic3d dataset. I refered to #226 , but it didn't work.

zcy1065670505 avatar Mar 27 '21 06:03 zcy1065670505

@zcy1065670505 Hi there! I tried by following the instructions in #226 , still, it didn't work. So I switched back to RandLA tensorflow version.

Katherine2013 avatar Mar 27 '21 12:03 Katherine2013

Hi For my perject reason, It must be RandLA-Torch Version, Anyway can make it work ?

---Original--- From: @.> Date: Sat, Mar 27, 2021 20:07 PM To: @.>; Cc: @.@.>; Subject: Re: [intel-isl/Open3D-ML] 'S3DISSplit' object has no attribute 'sampler' (#211)

@zcy1065670505 Hi there! I tried by following the instructions in #226 , still, it didn't work. So I switched back to RandLA tensorflow version.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

zcy1065670505 avatar Mar 28 '21 03:03 zcy1065670505

@zcy1065670505 You can try some of the unofficial versions of pytorch RandLA on GitHub. But to my experience, feeding them by custom datasets may face some unexpected problems. Good luck!

Katherine2013 avatar Mar 28 '21 08:03 Katherine2013

@zcy1065670505 #226 fix is merged to the dev branch which will be merged to master in the next release( within 3-4 weeks). For the time being, you can use dev branch, I'll create a separate PR to master for the fix.

sanskar107 avatar Mar 28 '21 09:03 sanskar107

Hi @sanskar107, tried to run the custom3D torch script under dev branch however I still experienced the missing sampler attribute. Any advices will be appreciated!

INFO - 2021-04-06 03:10:01,543 - semantic_segmentation - DEVICE : cuda
INFO - 2021-04-06 03:10:01,543 - semantic_segmentation - Logging in file : ./logs/RandLANet_Custom3D_torch/log_train_2021-04-06_03:10:01.txt
INFO - 2021-04-06 03:10:01,544 - customdataset - Found 2 pointclouds for train
Traceback (most recent call last):
  File "/content/Open3D-ML/scripts/run_pipeline.py", line 134, in <module>
    main()
  File "/content/Open3D-ML/scripts/run_pipeline.py", line 130, in main
    pipeline.run_train()
  File "/usr/local/lib/python3.7/dist-packages/open3d/_ml3d/torch/pipelines/semantic_segmentation.py", line 313, in run_train
    train_sampler = train_dataset.sampler
AttributeError: 'Custom3DSplit' object has no attribute 'sampler'

StellaLulu avatar Apr 06 '21 03:04 StellaLulu

@stellactyy From your error message usr/local/lib/python3.7/dist-packages/open3d/_ml3d/torch/pipelines/semantic_segmentation.py , it looks like bundled Open3D-ML is being used which comes with the wheel. Please source set_open3d_ml_root.sh to use the dev branch.

sanskar107 avatar Apr 06 '21 06:04 sanskar107

@sanskar107 Yes I have already source /content/Open3D-ML/set_open3d_ml_root.sh after switching the git clone repo to dev branch, however it still resulted in using the Open3D-ML in python3.7.

StellaLulu avatar Apr 07 '21 07:04 StellaLulu

The following updating can make it work. Edit the '~/.local/lib/python3.8/site-packages/open3d/_ml3d/datasets/s3dis.py' class S3DISSplit(): to class S3DISSplit(BaseDatasetSplit): and

 def __init__(self, dataset, split='training'):
        super().__init__(dataset, split=split)

eiiijiiiy avatar May 02 '21 14:05 eiiijiiiy

Thanks @eiiijiiiy it works for me!

StellaLulu avatar May 28 '21 06:05 StellaLulu

Fixed in the latest release.

sanskar107 avatar Jun 03 '21 08:06 sanskar107