While preparing an environment with PyTorch and after installing all the packages needed using the miniconda terminal, an error showed up in the final step of the process which is the verifying of installation.
I created a conda environment and activated it,
then I installed PyTorch and all the packages needed using MIM.
- MMEngine
- MMCV
- MMDetection
- MMDetection3D
I also successfully downloaded config and checkpoint files using the following command ;
mim download mmdet3d --config pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car --dest
However in the final step to verify the installation I got the error message.
from mmdet3d.apis import init_model, inference_detector
config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py'
checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth'
model = init_model(config_file, checkpoint_file)
inference_detector(model, 'demo/data/kitti/000008.bin')
Output
C:\Users\ANIS\miniconda3\envs\openmmlab\lib\site-packages\mmdet3d\models\dense_heads\anchor3d_head.py:92: UserWarning: dir_offset and dir_limit_offset wi 11 be depressed and be incorporated into box coder in the future
warnings.warn(
Loads checkpoint by local backend from path: hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth
The Error message is shown below and in the screenshot from jupyter notebook.
Traceback
AttributeError Traceback (most recent call last)
Cell In[1], line 5
3 config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py'
4 checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth'
----> 5 model = init_model(config_file, checkpoint_file)
6 inference_detector(model, 'demo/data/kitti/000008.bin')
File ~\miniconda3/envs\openmmlab\lib\site-packages\mmdet3d\apis\inference.py:92, in init_model(config, checkpoint, device, cfg_options)
90 model.cfg = config # save the config in the model for convenience
91 if device != 'cpu':
---> 92 torch.cuda.set_device (device)
93 else:
94 warnings.warn('Don\'t suggest using CPU device. '
95 'Some functions are not supported for now.')
File ~\miniconda3/envs\openmmlab\lib\site-packages\torch\cuda\____init__.py:350, in set_device(device)
348 device = ___get_device_index(device)
349 if device >= 0:
--> 350 torch._C._cuda_setDevice(device)
AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'