Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dcnv3
Commits
1ccf7825
Commit
1ccf7825
authored
Jan 16, 2025
by
zhe chen
Browse files
Update README for onnx export (#39)
parent
8e2cb4fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
classification/README.md
classification/README.md
+21
-0
No files found.
classification/README.md
View file @
1ccf7825
...
...
@@ -357,6 +357,12 @@ python extract_feature.py --cfg configs/internimage_t_1k_224.yaml --img b.png --
## Export
Install
`mmdeploy`
at first:
```
shell
pip
```
To export
`InternImage-T`
from PyTorch to ONNX, run:
```
shell
...
...
@@ -366,5 +372,20 @@ python export.py --model_name internimage_t_1k_224 --ckpt_dir /path/to/ckpt/dir
To export
`InternImage-T`
from PyTorch to TensorRT, run:
```
shell
git clone https://github.com/open-mmlab/mmdeploy.git
cd
mmdeploy
&&
git checkout v0.13.0
export
MMDEPLOY_DIR
=
$(
pwd
)
# prepare our custom ops, you can find it at InternImage/tensorrt/modulated_deform_conv_v3
cp
-r
../../tensorrt/modulated_deform_conv_v3 csrc/mmdeploy/backend_ops/tensorrt/
# build custom ops
mkdir
-p
build
&&
cd
build
cmake
-DCMAKE_CXX_COMPILER
=
g++
-DMMDEPLOY_TARGET_BACKENDS
=
trt
-DTENSORRT_DIR
=
${
TENSORRT_DIR
}
-DCUDNN_DIR
=
${
CUDNN_DIR
}
..
make
-j
$(
nproc
)
&&
make
install
# install the mmdeploy after building custom ops
pip
install
-e
.
cd
../
python export.py
--model_name
internimage_t_1k_224
--ckpt_dir
/path/to/ckpt/dir
--trt
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment