开发者社区 > ModelScope模型即服务 > 计算机视觉 > 正文

当前版本使用GPU执行预测是否有问题?

face.png 调用的是106点人脸关键点-通用领域-2D(damo/cv_mobilenet_face-2d-keypoints_alignment)模型

20230303问题补充 python requirements absl-py==1.4.0 addict==2.4.0 aiohttp==3.8.4 aiosignal==1.3.1 albumentations==1.3.0 aliyun-python-sdk-core==2.13.36 aliyun-python-sdk-kms==2.16.0 anyio==3.6.2 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 astor==0.8.1 async-timeout==4.0.2 asynctest==0.13.0 attrs==22.2.0 backcall==0.2.0 backports.lzma==0.0.14 beautifulsoup4==4.11.2 bleach==6.0.0 cachetools==5.3.0 certifi==2022.12.7 cffi==1.15.1 charset-normalizer==3.0.1 click==8.1.3 color-transfer==0.1 colorama==0.4.6 crcmod==1.7 cryptography==39.0.1 cycler==0.11.0 Cython==0.29.33 dataclasses==0.6 datasets==2.8.0 debugpy==1.6.6 decorator==5.1.1 decord==0.6.0 defusedxml==0.7.1 descartes==1.1.0 dill==0.3.6 distlib==0.3.6 easycv==0.3.0 einops==0.6.0 entrypoints==0.4 fastjsonschema==2.16.3 filelock==3.9.0 fire==0.5.0 fonttools==4.38.0 frozenlist==1.3.3 fsspec==2023.1.0 future==0.18.3 fvcore==0.1.5.post20221221 gast==0.2.2 google-pasta==0.2.0 grpcio==1.51.3 h5py==3.8.0 huggingface-hub==0.12.1 idna==3.4 imageio==2.26.0 imgaug==0.4.0 importlib-metadata==6.0.0 importlib-resources==5.12.0 iopath==0.1.10 ipykernel==6.16.2 ipython==7.34.0 ipython-genutils==0.2.0 ipywidgets==8.0.4 jedi==0.18.2 Jinja2==3.1.2 jmespath==0.10.0 joblib==1.2.0 json-tricks==3.16.1 jsonplus==0.8.0 jsonschema==4.17.3 jupyter==1.0.0 jupyter-console==6.6.2 jupyter-server==1.23.6 jupyter_client==7.4.9 jupyter_core==4.12.0 jupyterlab-pygments==0.2.2 jupyterlab-widgets==3.0.5 Keras-Applications==1.0.8 Keras-Preprocessing==1.1.2 kiwisolver==1.4.4 llvmlite==0.39.1 lmdb==1.4.0 Markdown==3.4.1 markdown-it-py==2.2.0 MarkupSafe==2.1.2 matplotlib==3.5.2 matplotlib-inline==0.1.6 mdurl==0.1.2 mistune==2.0.5 mmcv-full==1.7.1 mmdet==2.28.2 model-index==0.1.11 modelscope==1.3.0 msgpack==1.0.4 multidict==6.0.4 multiprocess==0.70.14 nbclassic==0.5.2 nbclient==0.7.2 nbconvert==7.2.9 nbformat==5.7.3 nest-asyncio==1.5.6 networkx==2.6.3 notebook==6.5.2 notebook_shim==0.2.2 numba==0.56.4 numpy==1.21.6 nuscenes-devkit==1.1.10 nvidia-cublas-cu11==11.10.3.66 nvidia-cuda-nvrtc-cu11==11.7.99 nvidia-cuda-runtime-cu11==11.7.99 nvidia-cudnn-cu11==8.5.0.96 opencv-python==4.7.0.72 opencv-python-headless==4.7.0.72 openmim==0.3.6 opt-einsum==3.3.0 ordered-set==4.1.0 oss2==2.16.0 packaging==23.0 pai-easycv==0.9.0 pandas==1.3.5 pandocfilters==1.5.0 parso==0.8.3 pexpect==4.8.0 pickleshare==0.7.5 Pillow==9.4.0 pkgutil_resolve_name==1.3.10 platformdirs==3.0.0 portalocker==2.7.0 prettytable==3.6.0 prometheus-client==0.16.0 prompt-toolkit==3.0.38 protobuf==4.22.0 psutil==5.9.4 ptyprocess==0.7.0 pyarrow==11.0.0 pyclipper==1.3.0.post4 pycocotools==2.0.6 pycparser==2.21 pycryptodome==3.17 Pygments==2.14.0 pyparsing==3.0.9 PyQt5==5.14.2 PyQt5-sip==12.11.1 pyquaternion==0.9.9 pyrsistent==0.19.3 python-dateutil==2.8.2 pytorch-metric-learning==2.0.1 pytz==2022.7.1 PyWavelets==1.3.0 PyYAML==6.0 pyzbar==0.1.9 pyzmq==25.0.0 qtconsole==5.4.0 QtPy==2.3.0 qudida==0.0.4 rapidfuzz==2.13.7 ray==2.3.0 regex==2022.10.31 requests==2.28.2 responses==0.18.0 rich==13.3.1 scikit-image==0.19.3 scikit-learn==1.0.2 scipy==1.7.3 Send2Trash==1.8.0 Shapely==1.8.5 simplejson==3.18.3 six==1.16.0 sklearn==0.0.post1 sniffio==1.3.0 sortedcontainers==2.4.0 soupsieve==2.4 tabulate==0.9.0 tensorboard==1.15.0 tensorflow-estimator==1.15.1 tensorflow-gpu==1.15.0 termcolor==2.2.0 terminado==0.17.1 terminaltables==3.1.10 thop==0.1.1.post2209072238 threadpoolctl==3.1.0 tifffile==2021.11.2 timm==0.5.4 tinycss2==1.2.1 tokenizers==0.13.2 torch==1.13.1 torchaudio==0.13.1 torchvision==0.14.1 tornado==6.2 tqdm==4.64.1 traitlets==5.9.0 transformers==4.26.1 typing_extensions==4.5.0 urllib3==1.26.14 virtualenv==20.20.0 wcwidth==0.2.6 webencodings==0.5.1 websocket-client==1.5.1 Werkzeug==2.2.3 wget==3.2 widgetsnbextension==4.0.5 wrapt==1.15.0 xtcocotools==1.13 xxhash==3.2.0 yacs==0.1.8 yapf==0.32.0 yarl==1.8.2 zipp==3.15.0

error log

2023-03-03 01:04:47,005 - modelscope - INFO - PyTorch version 1.13.1 Found. 2023-03-03 01:04:47,007 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer 2023-03-03 01:04:47,044 - modelscope - INFO - Loading done! Current index file version is 1.3.0, with md5 f901e61a56e4bba17ebc98a78eecdcbf and a total number of 746 components indexed 2023-03-03 01:04:48,284 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-03-03 01:04:48,490 - modelscope - INFO - File 1.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 1.png already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 10.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 11.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 2.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 3.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 4.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 5.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 6.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File 7.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File configuration.json already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File keypoints.jpg already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File pytorch_model.pt already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File README.md already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File result_002253.png already in cache, skip downloading! 2023-03-03 01:04:48,491 - modelscope - INFO - File result_002258.png already in cache, skip downloading! /apprun/program/python3/lib/python3.7/site-packages/mmcv/init.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' load checkpoint from local path: /root/.cache/modelscope/hub/damo/cv_mobilenet_face-2d-keypoints_alignment/pytorch_model.pt 2023-03-03 01:04:54,692 - modelscope - INFO - Model revision not specified, use the latest revision: v1.1.0 2023-03-03 01:04:54,855 - modelscope - INFO - File compare.jpg already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File configuration.json already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File face_detection.png already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File face_detection2.jpeg already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File mmcv_scrfd.py already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File pytorch_model.bin already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File README.md already in cache, skip downloading! 2023-03-03 01:04:54,855 - modelscope - INFO - File SCRFD-sota.jpg already in cache, skip downloading! 2023-03-03 01:04:54,859 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps 2023-03-03 01:04:54,859 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps. 2023-03-03 01:04:54,861 - modelscope - INFO - initialize model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps /apprun/program/python3/lib/python3.7/site-packages/mmdet/models/dense_heads/anchor_head.py:116: UserWarning: DeprecationWarning: num_anchors is deprecated, for consistency or also use num_base_priors instead warnings.warn('DeprecationWarning: num_anchors is deprecated, ' /apprun/program/python3/lib/python3.7/site-packages/mmdet/models/dense_heads/anchor_head.py:123: UserWarning: DeprecationWarning: anchor_generator is deprecated, please use "prior_generator" instead warnings.warn('DeprecationWarning: anchor_generator is deprecated, ' 2023-03-03 01:04:55,078 - modelscope - INFO - loading model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps/pytorch_model.bin load checkpoint from local path: /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps/pytorch_model.bin 2023-03-03 01:04:55,324 - modelscope - INFO - load model done /apprun/program/python3/lib/python3.7/site-packages/mmdet/core/anchor/anchor_generator.py:333: UserWarning: grid_anchors would be deprecated soon. Please use grid_priors warnings.warn('grid_anchors would be deprecated soon. ' /apprun/program/python3/lib/python3.7/site-packages/mmdet/core/anchor/anchor_generator.py:370: UserWarning: single_level_grid_anchors would be deprecated soon. Please use single_level_grid_priors 'single_level_grid_anchors would be deprecated soon. ' Traceback (most recent call last): File "mobilenet_face_detection.py", line 17, in output = face_2d_keypoints('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/keypoints_detect/test_img_face_2d_keypoints.png') File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/easycv_pipelines/face_2d_keypoints_pipeline.py", line 175, in call det_result = self.face_detection(img_rgb) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/face_detection_pipeline.py", line 81, in call return super().call(input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/base.py", line 196, in call output = self._process_single(input, *args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/base.py", line 231, in _process_single out = self.forward(out, **forward_params) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/face_detection_pipeline.py", line 97, in forward return self.detector(**input) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/base/base_torch_model.py", line 34, in call return self.postprocess(self.forward(*args, **kwargs)) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/scrfd_detect.py", line 79, in forward output_results=2) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 51, in forward return super().forward(*inputs, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 169, in forward return self.module(*inputs[0], **kwargs[0]) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 119, in new_func return old_func(*args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 174, in forward return self.forward_test(img, img_metas, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 147, in forward_test return self.simple_test(imgs[0], img_metas[0], **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/detectors/scrfd.py", line 114, in simple_test *outs, img_metas, rescale=rescale) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 208, in new_func return old_func(*args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/dense_heads/scrfd_head.py", line 719, in get_bboxes scale_factor, cfg, rescale) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/dense_heads/scrfd_head.py", line 837, in _get_bboxes_single multi_kps=mlvl_kps) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/core/post_processing/bbox_nms.py", line 69, in multiclass_nms bboxes, scores, labels = bboxes[inds], scores[inds], labels[inds] RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) [root@4ae97b9c42d9 data]# python3 mobilenet_face_detection.py > error.log 2023-03-03 01:05:27,548 - modelscope - INFO - PyTorch version 1.13.1 Found. 2023-03-03 01:05:27,550 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer 2023-03-03 01:05:27,584 - modelscope - INFO - Loading done! Current index file version is 1.3.0, with md5 f901e61a56e4bba17ebc98a78eecdcbf and a total number of 746 components indexed 2023-03-03 01:05:28,608 - modelscope - INFO - Model revision not specified, use the latest revision: v1.0.0 2023-03-03 01:05:28,813 - modelscope - INFO - File 1.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 1.png already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 10.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 11.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 2.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 3.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 4.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 5.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 6.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File 7.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File configuration.json already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File keypoints.jpg already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File pytorch_model.pt already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File README.md already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File result_002253.png already in cache, skip downloading! 2023-03-03 01:05:28,813 - modelscope - INFO - File result_002258.png already in cache, skip downloading! /apprun/program/python3/lib/python3.7/site-packages/mmcv/init.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' 2023-03-03 01:05:34,599 - modelscope - INFO - Model revision not specified, use the latest revision: v1.1.0 2023-03-03 01:05:34,767 - modelscope - INFO - File compare.jpg already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File configuration.json already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File face_detection.png already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File face_detection2.jpeg already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File mmcv_scrfd.py already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File pytorch_model.bin already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File README.md already in cache, skip downloading! 2023-03-03 01:05:34,767 - modelscope - INFO - File SCRFD-sota.jpg already in cache, skip downloading! 2023-03-03 01:05:34,771 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps 2023-03-03 01:05:34,771 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps. 2023-03-03 01:05:34,773 - modelscope - INFO - initialize model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps /apprun/program/python3/lib/python3.7/site-packages/mmdet/models/dense_heads/anchor_head.py:116: UserWarning: DeprecationWarning: num_anchors is deprecated, for consistency or also use num_base_priors instead warnings.warn('DeprecationWarning: num_anchors is deprecated, ' /apprun/program/python3/lib/python3.7/site-packages/mmdet/models/dense_heads/anchor_head.py:123: UserWarning: DeprecationWarning: anchor_generator is deprecated, please use "prior_generator" instead warnings.warn('DeprecationWarning: anchor_generator is deprecated, ' 2023-03-03 01:05:34,982 - modelscope - INFO - loading model from /root/.cache/modelscope/hub/damo/cv_resnet_facedetection_scrfd10gkps/pytorch_model.bin 2023-03-03 01:05:35,228 - modelscope - INFO - load model done /apprun/program/python3/lib/python3.7/site-packages/mmdet/core/anchor/anchor_generator.py:333: UserWarning: grid_anchors would be deprecated soon. Please use grid_priors warnings.warn('grid_anchors would be deprecated soon. ' /apprun/program/python3/lib/python3.7/site-packages/mmdet/core/anchor/anchor_generator.py:370: UserWarning: single_level_grid_anchors would be deprecated soon. Please use single_level_grid_priors 'single_level_grid_anchors would be deprecated soon. ' Traceback (most recent call last): File "mobilenet_face_detection.py", line 17, in output = face_2d_keypoints('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/keypoints_detect/test_img_face_2d_keypoints.png') File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/easycv_pipelines/face_2d_keypoints_pipeline.py", line 175, in call det_result = self.face_detection(img_rgb) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/face_detection_pipeline.py", line 81, in call return super().call(input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/base.py", line 196, in call output = self._process_single(input, *args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/base.py", line 231, in _process_single out = self.forward(out, **forward_params) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/pipelines/cv/face_detection_pipeline.py", line 97, in forward return self.detector(**input) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/base/base_torch_model.py", line 34, in call return self.postprocess(self.forward(*args, **kwargs)) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/scrfd_detect.py", line 79, in forward output_results=2) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 51, in forward return super().forward(*inputs, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 169, in forward return self.module(*inputs[0], **kwargs[0]) File "/apprun/program/python3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 119, in new_func return old_func(*args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 174, in forward return self.forward_test(img, img_metas, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 147, in forward_test return self.simple_test(imgs[0], img_metas[0], **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/detectors/scrfd.py", line 114, in simple_test *outs, img_metas, rescale=rescale) File "/apprun/program/python3/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 208, in new_func return old_func(*args, **kwargs) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/dense_heads/scrfd_head.py", line 719, in get_bboxes scale_factor, cfg, rescale) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/models/dense_heads/scrfd_head.py", line 837, in _get_bboxes_single multi_kps=mlvl_kps) File "/apprun/program/python3/lib/python3.7/site-packages/modelscope/models/cv/face_detection/scrfd/mmdet_patch/core/post_processing/bbox_nms.py", line 69, in multiclass_nms bboxes, scores, labels = bboxes[inds], scores[inds], labels[inds] RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

展开
收起
dlqdlq 2023-03-02 15:21:42 1424 0
3 条回答
写回答
取消 提交回答
  • 我也语到了这个问题。我是全新环境,按照官方文档 先安装了 pytorch cudatoolkit 又安装了mmcv-full,最后安装了 modelscope[cv]. 都是按照文档安装的。

    我调试的时候发现 labels 在cpu上,其他tensor 都在GPU上。我把 labels 移到 inds的相同的设备上后,问题就消失了。

    2023-03-14 17:58:18
    赞同 展开评论 打赏
  • 拉取了官方的GPU镜像,解决问题了,能够使用GPU进行预测

    2023-03-07 14:59:39
    赞同 展开评论 打赏
  • gpu和cpu预测场景都测试过,可以正确使用,请问你这边是怎么使用的呢,方便的话请附上调用的代码和完整log,我们尝试复现你的问题

    2023-03-02 20:14:54
    赞同 展开评论 打赏

包含图像分类、图像生成、人体人脸识别、动作识别、目标分割、视频生成、卡通画、视觉评价、三维视觉等多个领域

相关电子书

更多
DeepStream: GPU加速海量视频数据智能处理 立即下载
阿里巴巴高性能GPU架构与应用 立即下载
GPU在超大规模深度学习中的发展和应用 立即下载