prs-eth / ForAINet

official source code for paper entitled "Automated forest inventory: analysis of high-density airborne LiDAR point clouds with 3D deep learning"
50 stars 9 forks source link

运行eval.py文件 #8

Open Aerian222 opened 4 weeks ago

Aerian222 commented 4 weeks ago

谢谢您的工作,让我受益颇多。我尝试使用您公布的预训练权重进行测试,按照你的流程,我修改了如下文件eval.yaml,

defaults:

但是当我运行python eval.py时,显示如下错误

[2024-11-07 14:28:29,657][torch_points3d.trainer][INFO] - DEVICE : cuda [2024-11-07 14:28:29,664][torch_points3d.datasets.dataset_factory][ERROR] - This should happen only during testing Traceback (most recent call last): File "eval.py", line 13, in main trainer = Trainer(cfg) File "/root/autodl-tmp/ForAINet/PointCloudSegmentation/torch_points3d/trainer.py", line 48, in init self._initialize_trainer() File "/root/autodl-tmp/ForAINet/PointCloudSegmentation/torch_points3d/trainer.py", line 97, in _initialize_trainer self._dataset: BaseDataset = instantiate_dataset(self._cfg.data) File "/root/autodl-tmp/ForAINet/PointCloudSegmentation/torch_points3d/datasets/dataset_factory.py", line 45, in instantiate_dataset dataset_cls = get_dataset_class(dataset_config) File "/root/autodl-tmp/ForAINet/PointCloudSegmentation/torch_points3d/datasets/dataset_factory.py", line 20, in get_dataset_class dataset_paths = dataset_class.split(".") AttributeError: 'NoneType' object has no attribute 'split'

这似乎是 配置文件中缺失class参数,是eval.yaml需要加其他参数吗

bxiang233 commented 4 weeks ago

另外我直接测试的步骤如下: 1.下载您提供的pretrained model权重,放在outputs文件夹下; 2.修改eval.yaml文件如下 defaults: visualization: eval num_workers: 0 batch_size: 1 cuda: 0 weight_name: "PointGroup-PAPER" # Used during resume, select with model to load from [miou, macc, acc..., latest] enable_cudnn: True checkpoint_dir: "outputs" # "{your_output_log_path}/outputs/2020-01-28/11-04-13" model_name: PointGroup-PAPER precompute_multi_scale: True # Compute multiscate features on cpu for faster training / inference enable_dropout: False voting_runs: 1 data: fold: ['data_set1_5classes/treeinsfused/raw/CULS/CULS_plot_2_annotated_test.ply'] tracker_options: # Extra options for the tracker full_res: True make_submission: True ply_output: "vote1regular.ply" hydra: run: dir: ${checkpointdir}/eval/${now:%Y-%m-%d%H-%M-%S} 3.运行python eval.py指令

谢谢您的答复!

你好~我没见过这个错误……你试一下把模型的路径和数据的路径改成绝对路径呢?

Aerian222 commented 3 weeks ago

另外我直接测试的步骤如下: 1.下载您提供的pretrained model权重,放在outputs文件夹下; 2.修改eval.yaml文件如下 defaults: visualization: eval num_workers: 0 batch_size: 1 cuda: 0 weight_name: "PointGroup-PAPER" # Used during resume, select with model to load from [miou, macc, acc..., latest] enable_cudnn: True checkpoint_dir: "outputs" # "{your_output_log_path}/outputs/2020-01-28/11-04-13" model_name: PointGroup-PAPER precompute_multi_scale: True # Compute multiscate features on cpu for faster training / inference enable_dropout: False voting_runs: 1 data: fold: ['data_set1_5classes/treeinsfused/raw/CULS/CULS_plot_2_annotated_test.ply'] tracker_options: # Extra options for the tracker full_res: True make_submission: True ply_output: "vote1regular.ply" hydra: run: dir: ${checkpointdir}/eval/${now:%Y-%m-%d%H-%M-%S} 3.运行python eval.py指令 谢谢您的答复!

你好~我没见过这个错误……你试一下把模型的路径和数据的路径改成绝对路径呢?

非常感谢您的建议,现在可以运行了!在运行后的结果中,Instance_results_withColor_0.ply是单木实例分割的结果,vote1regular.ply_0.ply是语义分割的结果?但是为什么两个分割文件的点数不同,甚至语义分割的点数低于实例分割结果好几倍!此外,在可视化后能清楚的看见二者点密度相差很多,这是什么原因呢?再次谢谢您的工作,非常棒!

bxiang233 commented 3 weeks ago

另外我直接测试的步骤如下: 1.下载您提供的pretrained model权重,放在outputs文件夹下; 2.修改eval.yaml文件如下 defaults: visualization: eval num_workers: 0 batch_size: 1 cuda: 0 weight_name: "PointGroup-PAPER" # Used during resume, select with model to load from [miou, macc, acc..., latest] enable_cudnn: True checkpoint_dir: "outputs" # "{your_output_log_path}/outputs/2020-01-28/11-04-13" model_name: PointGroup-PAPER precompute_multi_scale: True # Compute multiscate features on cpu for faster training / inference enable_dropout: False voting_runs: 1 data: fold: ['data_set1_5classes/treeinsfused/raw/CULS/CULS_plot_2_annotated_test.ply'] tracker_options: # Extra options for the tracker full_res: True make_submission: True ply_output: "vote1regular.ply" hydra: run: dir: ${checkpointdir}/eval/${now:%Y-%m-%d%H-%M-%S} 3.运行python eval.py指令 谢谢您的答复!

你好~我没见过这个错误……你试一下把模型的路径和数据的路径改成绝对路径呢?

非常感谢您的建议,现在可以运行了!在运行后的结果中,Instance_results_withColor_0.ply是单木实例分割的结果,vote1regular.ply_0.ply是语义分割的结果?但是为什么两个分割文件的点数不同,甚至语义分割的点数低于实例分割结果好几倍!此外,在可视化后能清楚的看见二者点密度相差很多,这是什么原因呢?再次谢谢您的工作,非常棒!

哈喽,vote1regular是voxolization之后的,Semantic_resultsforEval{}.ply是和Instance_ResultsforEval{}.ply是和输入的点云点数一致的结果。

计算最终的metrics也是用完整点云计算的: (评估最终精度的代码:)PointCloudSegmentation/evaluation_stats_FOR.py

Aerian222 commented 3 weeks ago

另外我直接测试的步骤如下: 1.下载您提供的pretrained model权重,放在outputs文件夹下; 2.修改eval.yaml文件如下 defaults: visualization: eval num_workers: 0 batch_size: 1 cuda: 0 weight_name: "PointGroup-PAPER" # Used during resume, select with model to load from [miou, macc, acc..., latest] enable_cudnn: True checkpoint_dir: "outputs" # "{your_output_log_path}/outputs/2020-01-28/11-04-13" model_name: PointGroup-PAPER precompute_multi_scale: True # Compute multiscate features on cpu for faster training / inference enable_dropout: False voting_runs: 1 data: fold: ['data_set1_5classes/treeinsfused/raw/CULS/CULS_plot_2_annotated_test.ply'] tracker_options: # Extra options for the tracker full_res: True make_submission: True ply_output: "vote1regular.ply" hydra: run: dir: ${checkpointdir}/eval/${now:%Y-%m-%d%H-%M-%S} 3.运行python eval.py指令 谢谢您的答复!

你好~我没见过这个错误……你试一下把模型的路径和数据的路径改成绝对路径呢?

非常感谢您的建议,现在可以运行了!在运行后的结果中,Instance_results_withColor_0.ply是单木实例分割的结果,vote1regular.ply_0.ply是语义分割的结果?但是为什么两个分割文件的点数不同,甚至语义分割的点数低于实例分割结果好几倍!此外,在可视化后能清楚的看见二者点密度相差很多,这是什么原因呢?再次谢谢您的工作,非常棒!

哈喽,vote1regular是voxolization之后的,Semantic_resultsforEval{}.ply是和Instance_ResultsforEval{}.ply是和输入的点云点数一致的结果。

计算最终的metrics也是用完整点云计算的: (评估最终精度的代码:)PointCloudSegmentation/evaluation_stats_FOR.py

谢谢您,我明白了!您回复的很快,祝好!非常棒的工作!