SmartForest-no / SegmentAnyTree

MIT License
42 stars 11 forks source link

Error during inference #10

Open julesmorel opened 2 weeks ago

julesmorel commented 2 weeks ago

Thank you for your recent fixes, the inference is now starting. However it still ends with the following error:

Running the container Input directory: /home/datascience/tmp_in_folder Output directory: /home/datascience/tmp_out_folder Script directory: /home/nibio/mutable-outside-world Renamed: /home/datascience/tmp_out_folder/input_data/sample_sub01.laz to /home/datascience/tmp_out_folder/input_data/sample_sub01.laz Processing 1 files... Processing in utm2local: /home/datascience/tmp_out_folder/input_data/sample_sub01.laz Saving min values to: /home/datascience/tmp_out_folder/utm2local/sample_sub01_out_min_values.json Output files are saved in: /home/datascience/tmp_out_folder/utm2local Clearing: /home/datascience/tmp_out_folder/utm2local/treeinsfused/processed_0.2_test Path does not exist: /home/datascience/tmp_out_folder/utm2local/treeinsfused/processed_0.2_test /usr/local/lib/python3.8/dist-packages/wandb/init.py:998: SyntaxWarning: "is not" with a literal. Did you mean "!="? if name is None and resume is not "must": /usr/local/lib/python3.8/dist-packages/requests/init.py:102: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (5.2.0)/charset_normalizer (2.0.6) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported " /usr/local/lib/python3.8/dist-packages/MinkowskiEngine/init.py:36: UserWarning: The environment variable OMP_NUM_THREADS not set. MinkowskiEngine will automatically set OMP_NUM_THREADS=16. If you want to set OMP_NUM_THREADS manually, please export it on the command line before running a python script. e.g. export OMP_NUM_THREADS=12; python your_program.py. It is recommended to set it below 24. warnings.warn( [2024-11-11 01:07:36,313][torch_points3d.trainer][INFO] - DEVICE : cuda [2024-11-11 01:07:36,570][torch_points3d.metrics.model_checkpoint][INFO] - Loading checkpoint from /home/nibio/mutable-outside-world/model_file/PointGroup-PAPER.pt Processing... area_name: sample_sub01_out.ply data: Data(instance_labels=[9383781], pos=[9383781, 3], y=[9383781]) test_data_list: [[Data(instance_labels=[9383781], pos=[9383781, 3], y=[9383781])]] [2024-11-11 01:07:37,725][torch_points3d.datasets.segmentation.treeins][INFO] - pre_collate_transform ... [2024-11-11 01:07:37,726][torch_points3d.datasets.segmentation.treeins][INFO] - Compose([ SaveOriginalPosId, GridSampling3D(grid_size=0.2, quantize_coords=False, mode=last), ]) Done! test_data_list: [[Data(instance_labels=[9383781], pos=[9383781, 3], y=[9383781])]] [2024-11-11 01:07:40,606][torch_points3d.datasets.segmentation.treeins][INFO] - pre_collate_transform ... [2024-11-11 01:07:40,606][torch_points3d.datasets.segmentation.treeins][INFO] - Compose([ SaveOriginalPosId, GridSampling3D(grid_size=0.2, quantize_coords=False, mode=last), ]) [2024-11-11 01:07:46,299][torch_points3d.applications.minkowski][WARNING] - Minkowski API is deprecated in favor of the SparseConv3d API. It should be a simple drop in replacement (no change to the API). [2024-11-11 01:07:46,300][torch_points3d.applications.modelfactory][INFO] - The config will be used to build the model [2024-11-11 01:07:46,403][torch_points3d.applications.minkowski][WARNING] - Minkowski API is deprecated in favor of the SparseConv3d API. It should be a simple drop in replacement (no change to the API). [2024-11-11 01:07:46,403][torch_points3d.applications.modelfactory][INFO] - The config will be used to build the model [2024-11-11 01:07:46,452][torch_points3d.applications.minkowski][WARNING] - Minkowski API is deprecated in favor of the SparseConv3d API. It should be a simple drop in replacement (no change to the API). [2024-11-11 01:07:46,452][torch_points3d.applications.modelfactory][INFO] - The config will be used to build the model Traceback (most recent call last): File "eval.py", line 13, in main trainer = Trainer(cfg) File "/home/nibio/mutable-outside-world/torch_points3d/trainer.py", line 48, in init self._initialize_trainer() File "/home/nibio/mutable-outside-world/torch_points3d/trainer.py", line 91, in _initialize_trainer self._model: BaseModel = self._checkpoint.create_model( File "/home/nibio/mutable-outside-world/torch_points3d/metrics/model_checkpoint.py", line 181, in create_model model = instantiate_model(OmegaConf.create(run_config), dataset) File "/home/nibio/mutable-outside-world/torch_points3d/models/model_factory.py", line 44, in instantiate_model model = model_cls(model_config, "dummy", dataset, modellib) File "/home/nibio/mutable-outside-world/torch_points3d/models/panoptic/PointGroup3heads.py", line 99, in init thing_classes = dataset.thing_classes AttributeError: 'TreeinsFusedDataset' object has no attribute 'thing_classes'

julesmorel commented 2 weeks ago

I just saw this has been fixed in a pull request

keillernogueira commented 1 week ago

Hi @julesmorel , I am still facing this issue. Have you done anything else (besides pulling the updated code)?

dluks commented 5 days ago

I'm also encountering this issue with the latest commit. It looks like commit 8088462d6960d24ca71f6cde2e7589744a3ae1fb from #9 tries to address this, but the author also later said they're still encountering an issue.

keillernogueira commented 5 days ago

So, should we reopen this issue then?

dluks commented 4 days ago

I think generally an issue shouldn't be closed until a fix has been merged into main, so I'd vote to re-open. I can confirm that the fix proposed in #9 does appear to address this specific issue, but another issue arises when saving the segmentation results which may or may not be linked to issue reported here. Meanwhile, I think conversation could be moved to #9.

julesmorel commented 4 days ago

Indeed, I might have closed the issue a bit too fast.

On my side, the modifications torch_points3d/datasets/panoptic/treeins.py have solved the issue.

dluks commented 4 days ago

Great that you got it working on your end! Were the segmentation results reasonable? And I'm guessing you didn't encounter the same issue as reported at the end of #9 (type casting issue when merging and saving the points and segmentations)?