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

When run the profiler.py[Bug] #1569

Closed
3 tasks
ChenZhenGui opened this issue Dec 22, 2022 · 8 comments
Closed
3 tasks

When run the profiler.py[Bug] #1569

ChenZhenGui opened this issue Dec 22, 2022 · 8 comments

Comments

@ChenZhenGui
Copy link

Checklist

  • I have searched related issues but cannot get the expected help.
  • 2. I have read the FAQ documentation but cannot get the expected help.
  • 3. The bug has not been fixed in the latest version.

Describe the bug

When I run the profiler.py by the .pth model,there are some issue

Reproduction

python tools/profiler.py ./configs/mmpose/pose-detection_tensorrt_static-256x192.py /home/nvidia/Desktop/mmpose/configs/body_2d_keypoint/topdown_heatmap/coco/mobilevit_coco-256x192.py /home/nvidia/Desktop/mmdeploy/AP_epoch_200.pth /home/nvidia/Desktop/coco/val2017

Environment

12/22 18:12:04 - mmengine - INFO - 

12/22 18:12:04 - mmengine - INFO - **********Environmental information**********
/home/nvidia/miniforge3/envs/mobilevit_test/lib/python3.6/site-packages/torchvision/io/image.py:11: UserWarning: Failed to load image Python extension: 
  warn(f"Failed to load image Python extension: {e}")
12/22 18:12:06 - mmengine - INFO - sys.platform: linux
12/22 18:12:06 - mmengine - INFO - Python: 3.6.15 | packaged by conda-forge | (default, Dec  3 2021, 19:12:04) [GCC 9.4.0]
12/22 18:12:06 - mmengine - INFO - CUDA available: True
12/22 18:12:06 - mmengine - INFO - numpy_random_seed: 2147483648
12/22 18:12:06 - mmengine - INFO - GPU 0: NVIDIA Tegra X1
12/22 18:12:06 - mmengine - INFO - CUDA_HOME: /usr/local/cuda-10.2
12/22 18:12:06 - mmengine - INFO - NVCC: Cuda compilation tools, release 10.2, V10.2.300
12/22 18:12:06 - mmengine - INFO - GCC: gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
12/22 18:12:06 - mmengine - INFO - PyTorch: 1.8.0
12/22 18:12:06 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - GCC 7.5
  - C++ Version: 201402
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: NO AVX
  - CUDA Runtime 10.2
  - NVCC architecture flags: -gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_62,code=sm_62;-gencode;arch=compute_72,code=sm_72
  - CuDNN 8.2.1
    - Built with CuDNN 8.0
  - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=8.0.0, CXX_COMPILER=/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_XNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -DMISSING_ARM_VST1 -DMISSING_ARM_VLD1 -Wno-stringop-overflow, FORCE_FALLBACK_CUDA_MPI=1, LAPACK_INFO=open, TORCH_VERSION=1.8.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=OFF, USE_MPI=ON, USE_NCCL=0, USE_NNPACK=ON, USE_OPENMP=ON, 

12/22 18:12:06 - mmengine - INFO - TorchVision: 0.11.3
12/22 18:12:06 - mmengine - INFO - OpenCV: 4.6.0
12/22 18:12:06 - mmengine - INFO - MMEngine: 0.3.1
12/22 18:12:06 - mmengine - INFO - MMCV: 2.0.0rc2
12/22 18:12:06 - mmengine - INFO - MMCV Compiler: GCC 7.5
12/22 18:12:06 - mmengine - INFO - MMCV CUDA Compiler: 10.2
12/22 18:12:06 - mmengine - INFO - MMDeploy: 0.10.0+71344b2
12/22 18:12:06 - mmengine - INFO - 

12/22 18:12:06 - mmengine - INFO - **********Backend information**********
12/22 18:12:09 - mmengine - INFO - onnxruntime: None	ops_is_avaliable : False
12/22 18:12:10 - mmengine - INFO - tensorrt: 8.0.1.6	ops_is_avaliable : True
12/22 18:12:10 - mmengine - INFO - ncnn: None	ops_is_avaliable : False
12/22 18:12:10 - mmengine - INFO - pplnn_is_avaliable: False
12/22 18:12:10 - mmengine - INFO - openvino_is_avaliable: False
12/22 18:12:10 - mmengine - INFO - snpe_is_available: False
12/22 18:12:10 - mmengine - INFO - ascend_is_available: False
12/22 18:12:10 - mmengine - INFO - coreml_is_available: False
12/22 18:12:10 - mmengine - INFO - 

12/22 18:12:10 - mmengine - INFO - **********Codebase information**********
12/22 18:12:10 - mmengine - INFO - mmdet:	3.0.0rc3
12/22 18:12:10 - mmengine - INFO - mmseg:	None
12/22 18:12:10 - mmengine - INFO - mmcls:	None
12/22 18:12:10 - mmengine - INFO - mmocr:	None
12/22 18:12:10 - mmengine - INFO - mmedit:	None
12/22 18:12:10 - mmengine - INFO - mmdet3d:	None
12/22 18:12:10 - mmengine - INFO - mmpose:	1.0.0rc0
12/22 18:12:10 - mmengine - INFO - mmrotate:	None
12/22 18:12:10 - mmengine - INFO - mmaction:	None

Error traceback

Traceback (most recent call last):
  File "tools/profiler.py", line 168, in <module>
    main()
  File "tools/profiler.py", line 153, in main
    model.test_step(data)
  File "/home/nvidia/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 948, in __getattr__
    type(self).__name__, name))
AttributeError: 'TorchWrapper' object has no attribute 'test_step'
@AllentDan
Copy link
Member

Hi, @ChenZhenGui The usage of profiler.py is python tools/profiler.py deploy_cfg model_cfg image_dir --model model.

@ChenZhenGui
Copy link
Author

Hi, @ChenZhenGui The usage of profiler.py is python tools/profiler.py deploy_cfg model_cfg image_dir --model model.

hello,I have modified the parameter order according to your format, but the same error will still be reported:
Traceback (most recent call last):
File "tools/profiler.py", line 168, in
main()
File "tools/profiler.py", line 153, in main
model.test_step(data)
File "/home/nvidia/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 948, in getattr
type(self).name, name))
AttributeError: 'TorchWrapper' object has no attribute 'test_step'

@ChenZhenGui
Copy link
Author

Everything worked fine when I ran the tensorrt format model

@ChenZhenGui
Copy link
Author

I'm sorry this is an urgent question for me

@AllentDan
Copy link
Member

Please paste the cmd you used.

@AllentDan
Copy link
Member

Hi, @ChenZhenGui. I found the error and fixed it in PR #1600.

@github-actions
Copy link

This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.

@github-actions github-actions bot added the Stale label Mar 23, 2023
@ChenZhenGui
Copy link
Author

ChenZhenGui commented Mar 23, 2023 via email

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

No branches or pull requests

3 participants