Comments (5)
@v3551G 您好,感谢您的关注~
我们核查后发现是我们目前版本的代码中针对较新的pytorch版本的兼容性有一些问题,我们会在之后的版本进行兼容性验证与修复,感谢您的发现!
首先,由于您的设备RTX3090只支持cuda11及以上版本,您需要安装满足要求的cudatoolkit库。
其次,对于当前DAMO-YOLO的版本,我们向您提供以下2种暂时的解决方案:
- 安装环境时,选择pytorch版本为:>=1.7.0 且 <=1.10.1 (兼容当前DAMO-YOLO版本),并且选择cudatoolkit版本为11.0及以上(兼容您的RTX3090设备)。例如,您可以使用如下版本的安装命令:
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
- 或者,您可以手动将此处的条件判断代码修改为如下代码以暂时避开这个问题:
import sys
if sys.version_info[0] == 3 and sys.version_info[1] >= 7:
当然,您也可以等待我们之后的代码更新。
如果您还有进一步的问题,可以随时联系我们~
from damo-yolo.
@v3551G 您好,感谢您的关注~
我们核查后发现是我们目前版本的代码中针对较新的pytorch版本的兼容性有一些问题,我们会在之后的版本进行兼容性验证与修复,感谢您的发现!
首先,对于您的设备RTX3090,您需要安装版本为11.0及以上的cudatoolkit库。
其次,对于当前DAMO-YOLO的版本,我们向您提供以下2种暂时的解决方案:
1. 安装环境时,选择pytorch版本为:>=1.7.0 且 <=1.10.1 (兼容当前DAMO-YOLO版本),并且选择cudatoolkit版本为11.0及以上(兼容您的RTX3090设备)。例如,您可以使用如下版本的安装命令:
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge2. 或者,您可以手动将[此处](https://github.com/tinyvision/DAMO-YOLO/blob/9fb21b8e5741c171d55a4a59218fbbfdfe929d2c/damo/utils/imports.py#L4)的条件判断代码修改为如下代码以暂时避开这个问题:
import sys if sys.version_info[0] == 3 and sys.version_info[1] >= 7:当然,您也可以等待我们之后的代码更新。
如果您还有进一步的问题,可以随时联系我们~
谢谢,这个问题解决了,
不过在执行如下命令
(damo-yolo) masterqkk@QKK:~/workspace/pycharm/DAMO-YOLO$ python tools/converter.py -f configs/damoyolo_tinynasL25_S.py -c models/damoyolo_tinynasL25_S.pth --batch_size 1 --img_size
转换模型时又报错:
Traceback (most recent call last):
File "/home/masterqkk/workspace/pycharm/DAMO-YOLO/tools/converter.py", line 6, in
import torch
ModuleNotFoundError: No module named 'torch'
这个是什么原因? 我是完全按官方教程装的, 还需要另外再装torch吗?
我用如下命令装了torch之后,
pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple
又报错:
Traceback (most recent call last):
File "/home/masterqkk/workspace/pycharm/DAMO-YOLO/tools/converter.py", line 6, in
import torch
File "/home/masterqkk/.local/lib/python3.9/site-packages/torch/init.py", line 191, in
_load_global_deps()
File "/home/masterqkk/.local/lib/python3.9/site-packages/torch/init.py", line 153, in _load_global_deps
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
File "/home/masterqkk/anaconda3/lib/python3.9/ctypes/init.py", line 382, in init
self._handle = _dlopen(self._name, mode)
OSError: /home/masterqkk/.local/lib/python3.9/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11
from damo-yolo.
您好,从您的torch调用的路径看起来您是在系统环境下安装的pytorch,这个可能会使环境混乱并导致各个包的版本出现兼容问题。
为了方便环境搭建与修改,建议您创建一个新的conda环境,并在次conda环境下重新尝试整个安装过程,并把安装pytorch的conda命令替换为上面建议的那个命令:
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
from damo-yolo.
您好,从您的torch调用的路径看起来您是在系统环境下安装的pytorch,这个可能会使环境混乱并导致各个包的版本出现兼容问题。
为了方便环境搭建与修改,建议您创建一个新的conda环境,并在次conda环境下重新尝试整个安装过程,并把安装pytorch的conda命令替换为上面建议的那个命令:
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
谢谢,重新说下问题吧.
我的是RTX3090, CUDA11.4 已安装 (CUDA 与CUDNN没问题,一直在用)
创建damo-yolo环境命令如下:
git clone https://github.com/tinyvision/damo-yolo.git
cd DAMO-YOLO/
conda create -n DAMO-YOLO python=3.7 -y
conda activate DAMO-YOLO
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
pip install -r requirements.txt
export PYTHONPATH=$PWD:$PYTHONPATH
pip3 install cython;
pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
pip install onnx==1.8.1
pip install onnxruntime==1.8.0
pip install onnx-simplifier==0.3.5
pip install pycuda==2022.1
创建完成后,运行pth, onnx模型的推理命令, pth转onnx的命令都成功.
问题在于:运行pth转trt的命令
python tools/converter.py -f configs/damoyolo_tinynasL25_S.py -c models/damoyolo_tinynasL25_S.pth --batch_size 1 --img_size 640 --trt --end2end --trt_eval
时报错,
错误信息如下:
2022-12-10 14:52:38.323 | INFO | main:main:231 - Starting to simplify ONNX...
2022-12-10 14:52:39.278 | INFO | main:main:235 - simplify failed: [ONNXRuntimeError] : 1 : FAIL : Fatal error: BatchedNMSDynamic_TRT is not a registered function/op
2022-12-10 14:52:39.364 | INFO | main:main:237 - generated onnx model named damoyolo_tinynasL25_S_end2end.onnx
2022-12-10 14:52:39.385 | INFO | main:trt_export:119 - trt_fp32 converting ...
2022-12-10 14:52:40.524 | ERROR | main:main:240 - An error has been caught in function 'main', process 'MainProcess' (2505498), thread 'MainThread' (140045316150464):
Traceback (most recent call last):
File "tools/converter.py", line 249, in
main()
└ <function main at 0x7f5de398c200>
File "tools/converter.py", line 240, in main
args.img_size, args.half)
│ │ │ └ False
│ │ └ Namespace(batch_size=1, ckpt='models/damoyolo_tinynasL25_S.pth', conf_thres=0.5, config_file='configs/damoyolo_tinynasL25_S.p...
│ └ 640
└ Namespace(batch_size=1, ckpt='models/damoyolo_tinynasL25_S.pth', conf_thres=0.5, config_file='configs/damoyolo_tinynasL25_S.p...
File "tools/converter.py", line 124, in trt_export
builder.max_workspace_size = 1 << 30
└ <tensorrt.tensorrt.Builder object at 0x7f5de1a26f70>
AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size'
2022-12-10 14:52:40.525 | ERROR | main::249 - An error has been caught in function '', process 'MainProcess' (2505498), thread 'MainThread' (140045316150464):
Traceback (most recent call last):
File "tools/converter.py", line 249, in
main()
└ <function main at 0x7f5de398c200>
File "tools/converter.py", line 242, in main
from trt_eval import trt_inference
File "/home/masterqkk/workspace/pycharm/DAMO-YOLO/tools/trt_eval.py", line 11, in
from damo.apis.detector_inference_trt import inference
File "/home/masterqkk/workspace/pycharm/DAMO-YOLO/damo/apis/detector_inference_trt.py", line 11, in
from cuda import cuda
ModuleNotFoundError: No module named 'cuda'
可以看到:
(1)TensorRT的版本不太对, 导致AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size',针对我的环境, 您建议的TensorRT版本是?
(2) 找不到cuda模块,这是那个命令引起的问题?
from damo-yolo.
我们目前的trt版本是tensorrt-7.2.1.6,这个版本主要是适配pytorch==1.7.0和cudatoolkit=10.2。cudatoolkit=11.3对应的trt版本我们暂时还没有确认。感谢提问,后续我们会适配下cudatoolkit=11.x。
from damo-yolo.
Related Issues (20)
- Error: DAMO-YOLO的MAE-NAS教程 link not found
- 使用modelscope调用模型的问题
- 701类别的模型如何使用
- 关于CWD_Loss的问题
- error when i training damo-yolo to ditect face HOT 1
- What tool was used to create the diagrams?
- Batch size不匹配的问题
- 如何测试模型在GPU上的latency?
- How to freeze backbone when finetune on custom dataset HOT 1
- [Bug]:
- 测评类别mAP
- 官方提供的人头检测模型结果偏差比较大
- Integrated DAMO-YOLO Algorithm into X-AnyLabeling for Enhanced Annotation
- KeyPoint estimation
- Image normalization strategy
- 运行出现bug 这么解决 HOT 1
- Tensorboard integration
- [Bug]: not found link for pretrained model damoyolo_tinynasL20_N.py (tinynas_L20_k1kx_nano.txt)
- Slow traning
- [Bug]: cv2.error: OpenCV(4.9.0) :-1: error: (-5:Bad argument) in function 'rectangle' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from damo-yolo.