open-mmlab / mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
https://mmaction2.readthedocs.io
Apache License 2.0
4.17k stars 1.22k forks source link

spatiotemporal_det.py error #1524

Closed Ishihara-Masabumi closed 2 years ago

Ishihara-Masabumi commented 2 years ago

When I tried to use demo_spatiotemporal_det.py using the following command

python3 demo/demo_spatiotemporal_det.py --video demo/ex3.mp4

the following error message has occurred.

/home/********/anaconda3/lib/python3.9/site-packages/mmcv/cnn/bricks/transformer.py:33: UserWarning: Fail to import ``MultiScaleDeformableAttention`` from ``mmcv.ops.multi_scale_deform_attn``, You should install ``mmcv-full`` if you need this module. 
  warnings.warn('Fail to import ``MultiScaleDeformableAttention`` from '
/home/ishihara/mmdetection/mmdet/models/utils/transformer.py:26: UserWarning: `MultiScaleDeformableAttention` in MMCV has been moved to `mmcv.ops.multi_scale_deform_attn`, please update your MMCV
  warnings.warn(
/home/ishihara/mmdetection/mmdet/models/utils/transformer.py:26: UserWarning: `MultiScaleDeformableAttention` in MMCV has been moved to `mmcv.ops.multi_scale_deform_attn`, please update your MMCV
  warnings.warn(
/home/ishihara/mmdetection/mmdet/models/utils/transformer.py:26: UserWarning: `MultiScaleDeformableAttention` in MMCV has been moved to `mmcv.ops.multi_scale_deform_attn`, please update your MMCV
  warnings.warn(
/home/ishihara/mmdetection/mmdet/models/utils/transformer.py:26: UserWarning: `MultiScaleDeformableAttention` in MMCV has been moved to `mmcv.ops.multi_scale_deform_attn`, please update your MMCV
  warnings.warn(
Traceback (most recent call last):
  File "/home/ishihara/mmaction2/demo/demo_spatiotemporal_det.py", line 428, in <module>
    main()
  File "/home/ishihara/mmaction2/demo/demo_spatiotemporal_det.py", line 329, in main
    human_detections = detection_inference(args, center_frames)
  File "/home/ishihara/mmaction2/demo/demo_spatiotemporal_det.py", line 225, in detection_inference
    model = init_detector(args.det_config, args.det_checkpoint, args.device)
  File "/home/ishihara/mmaction2/mmaction/utils/decorators.py", line 12, in new_func
    raise ImportError(
ImportError: Please install mmdet to use init_detector. For OpenMMLAB codebases, you may need to install mmcv-full first before you install the particular codebase. 
Segmentation fault (core dump)
hukkai commented 2 years ago

I think the error is clear as in the log: you need to install mmdet which is also stated in the installation file (https://github.com/open-mmlab/mmaction2/blob/master/docs/install.md):

d. Install mmdetection for spatial temporal detection tasks.
Ishihara-Masabumi commented 2 years ago

Thank you for your reply. BTW, my environment is CPU only. The solution of CPU only is the same as the above?

dreamerlin commented 2 years ago

I am afraid that CPU may not support some CUDA ops in MMDet

Ishihara-Masabumi commented 2 years ago

Then, how can I use mmaction2 on the environment of CPU only ?

hukkai commented 2 years ago

I would suggest that you run the code on the CPU first and then ask questions if there are errors. As I saw the codes for the action detection demo, it allowed the CPU device.

Ishihara-Masabumi commented 2 years ago

Thank you for your reply. Then, I will try to run the code next week!

Ishihara-Masabumi commented 2 years ago

Thank you. Today, I can run demo_spatiotemporal_det.py.