Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A error when running inference.py #129

Open
ncut2020tjw opened this issue Apr 6, 2024 · 1 comment
Open

A error when running inference.py #129

ncut2020tjw opened this issue Apr 6, 2024 · 1 comment

Comments

@ncut2020tjw
Copy link

ncut2020tjw commented Apr 6, 2024

I have successfully train and test second_early_fusion.yaml and second_intermediate_fusion.yaml. However,I meet this error when I test config of second_late_fusion.

File "/graduation-project/OpenCOOD/opencood/data_utils/post_processor/voxel_postprocessor.py", line 263, in post_process
assert cav_id in output_dict

How could I solve this error? Any advice would be greatly appreciated!

(opencood) root@2406a1b90c16:/graduation-project/OpenCOOD# python opencood/tools/inference.py --model_dir /graduation-project/OpenCOOD/opencood/logs/second_late_fusion_low_res_2024_04_04_07_28_25 --fusion_method intermediate
Dataset Building
550 samples found.
/root/anaconda3/envs/opencood/lib/python3.7/site-packages/torch/utils/data/dataloader.py:560: UserWarning: This DataLoader will create 16 worker processes in total. Our suggested max number of worker in current system is 8, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
cpuset_checked))
Creating Model
Loading Model from checkpoint
resuming by loading epoch 40
0it [00:00, ?it/s]/root/anaconda3/envs/opencood/lib/python3.7/site-packages/torch/nn/functional.py:1960: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
0it [00:05, ?it/s]
Traceback (most recent call last):
File "opencood/tools/inference.py", line 208, in
main()
File "opencood/tools/inference.py", line 121, in main
opencood_dataset)
File "/graduation-project/OpenCOOD/opencood/tools/inference_utils.py", line 90, in inference_intermediate_fusion
return inference_early_fusion(batch_data, model, dataset)
File "/graduation-project/OpenCOOD/opencood/tools/inference_utils.py", line 68, in inference_early_fusion
output_dict)
File "/graduation-project/OpenCOOD/opencood/data_utils/datasets/late_fusion_dataset.py", line 270, in post_process
self.post_processor.post_process(data_dict, output_dict)
File "/graduation-project/OpenCOOD/opencood/data_utils/post_processor/voxel_postprocessor.py", line 263, in post_process
assert cav_id in output_dict
AssertionError

@ncut2020tjw ncut2020tjw changed the title There is a test error when running inference。py There is a test error when running inference.py Apr 6, 2024
@ncut2020tjw ncut2020tjw changed the title There is a test error when running inference.py A error when running inference.py Apr 6, 2024
@MrBryant23
Copy link

我已经成功训练并测试了second_early_fusion.yaml和second_intermediate_fusion.yaml。然而,我在测试second_late_fusion的配置时遇到了这个错误。

文件“/graduation-project/OpenCOOD/opencood/data_utils/post_processor/voxel_postprocessor.py”,第 263 行,在 post_process 中 断言 output_dict 中的 cav_id

我该如何解决这个错误?任何建议都将不胜感激!

(opencood) root@2406a1b90c16:/graduation-project/OpenCOOD# python opencood/tools/inference.py --model_dir /graduation-project/OpenCOOD/opencood/logs/second_late_fusion_low_res_2024_04_04_07_28_25 --fusion_method 中间 数据集构建 550 个样本。/root/anaconda3/envs/opencood/lib/python3.7/site-packages/torch/utils/data/dataloader.py:560 : UserWarning: 此 DataLoader 将总共创建 16 个工作进程。我们建议当前系统中的最大工作进程数为 8,这比此 DataLoader 将要创建的数量要少。请注意,过多的工作进程创建可能会导致 DataLoader 运行缓慢甚至冻结,如有必要,请减少工作进程数量以避免潜在的运行缓慢/冻结。 cpuset_checked)) 创建模型 从检查点加载模型 通过加载 epoch 40 恢复 0it [00:00, ?it/s]/root/anaconda3/envs/opencood/lib/python3.7/site-packages/torch/nn/ functional.py:1960: UserWarning: nn. functional.sigmoid 已弃用。请改用 torch.sigmoid。 warnings.warn("nn. functional.sigmoid 已弃用。请改用 torch.sigmoid。") 0it [00:05, ?it/s] Traceback(最近一次调用): 文件“opencood/tools/inference.py”,第 208 行,在 main()中 文件“opencood/tools/inference.py”,第 121 行,在主 opencood_dataset 中) 文件“/graduation-project/OpenCOOD/opencood/tools/inference_utils.py”,第 90 行,在 inference_intermediate_fusion 中 返回 inference_early_fusion(batch_data, model, dataset) 文件“/graduation-project/OpenCOOD/opencood/tools/inference_utils.py”,第 68 行,在 inference_early_fusion output_dict中 文件“/graduation-project/OpenCOOD/opencood/data_utils/datasets/late_fusion_dataset.py”,行270,在 post_process self.post_processor.post_process(data_dict, output_dict) 文件“/graduation-project/OpenCOOD/opencood/data_utils/post_processor/voxel_postprocessor.py”,第 263 行,在 post_process 断言 output_dict 中的 cav_id AssertionError

我也遇到了类似的问题,请问您解决了吗,如果解决了可以告诉我是如何解决的吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants