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
ModelZoo
ResNet50_onnxruntime
Commits
efb0ea9f
Commit
efb0ea9f
authored
Aug 19, 2024
by
yangql
Browse files
增加对dtk24.04.1的支持,以及对k100_AI的支持。
parent
1b47efb3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
CMakeLists.txt
CMakeLists.txt
+1
-0
README.md
README.md
+3
-3
Src/Classifier.h
Src/Classifier.h
+1
-1
Src/Utility/Filesystem.cpp
Src/Utility/Filesystem.cpp
+2
-2
Src/Utility/SimpleLog.h
Src/Utility/SimpleLog.h
+1
-1
No files found.
CMakeLists.txt
View file @
efb0ea9f
...
@@ -13,6 +13,7 @@ set(CMAKE_BUILD_TYPE release)
...
@@ -13,6 +13,7 @@ set(CMAKE_BUILD_TYPE release)
set
(
INCLUDE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/
set
(
INCLUDE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Utility/
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Utility/
$ENV{DTKROOT}/include/
$ENV{DTKROOT}/include/
$ENV{DTKROOT}/onnxruntime/include/
${
CMAKE_CURRENT_SOURCE_DIR
}
/depend/include/
)
${
CMAKE_CURRENT_SOURCE_DIR
}
/depend/include/
)
include_directories
(
${
INCLUDE_PATH
}
)
include_directories
(
${
INCLUDE_PATH
}
)
...
...
README.md
View file @
efb0ea9f
...
@@ -18,12 +18,12 @@ ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯
...
@@ -18,12 +18,12 @@ ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯
### Docker(方法一)
### Docker(方法一)
拉取镜像:
拉取镜像:
```
python
```
python
docker
pull
image
.
sourcefind
.
cn
:
5000
/
dcu
/
admin
/
base
/
custom
:
ort1
.
14.0
_migraphx3
.
0.0
-
dtk2
2
.
10.1
docker
pull
image
.
sourcefind
.
cn
:
5000
/
dcu
/
admin
/
base
/
migraphx
:
4.3
.
0
-
ubuntu2
0
.
0
4
-
dtk2
4
.
04.1
-
py3
.
10
```
```
创建并启动容器:
创建并启动容器:
```
```
docker run --shm-size 16g --network=host --name=resnet50_o
rt
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/resnet50_onnxruntime:/home/resnet50_onnxruntime -it <Your Image ID> /bin/bash
docker run --shm-size 16g --network=host --name=resnet50_o
nnxruntime -v /opt/hyhal:/opt/hyhal:ro
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/resnet50_onnxruntime:/home/resnet50_onnxruntime -it <Your Image ID> /bin/bash
# 激活dtk
# 激活dtk
source /opt/dtk/env.sh
source /opt/dtk/env.sh
...
@@ -33,7 +33,7 @@ source /opt/dtk/env.sh
...
@@ -33,7 +33,7 @@ source /opt/dtk/env.sh
cd ./docker
cd ./docker
docker build --no-cache -t resnet50_onnxruntime:2.0 .
docker build --no-cache -t resnet50_onnxruntime:2.0 .
docker run --shm-size 16g --network=host --name=resnet50_o
rt
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/resnet50_onnxruntime:/home/resnet50_onnxruntime -it <Your Image ID> /bin/bash
docker run --shm-size 16g --network=host --name=resnet50_o
nnxruntime -v /opt/hyhal:/opt/hyhal:ro
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/resnet50_onnxruntime:/home/resnet50_onnxruntime -it <Your Image ID> /bin/bash
```
```
## 数据集
## 数据集
...
...
Src/Classifier.h
View file @
efb0ea9f
#ifndef __CLASSIFIER_H__
#ifndef __CLASSIFIER_H__
#define __CLASSIFIER_H__
#define __CLASSIFIER_H__
#include <onnxruntime
/core/session/onnxruntime
_cxx_api.h>
#include <onnxruntime_cxx_api.h>
#include <CommonDefinition.h>
#include <CommonDefinition.h>
namespace
ortSamples
namespace
ortSamples
...
...
Src/Utility/Filesystem.cpp
View file @
efb0ea9f
...
@@ -679,9 +679,9 @@ static std::vector<std::string> SplitString(std::string str, std::string separat
...
@@ -679,9 +679,9 @@ static std::vector<std::string> SplitString(std::string str, std::string separat
// process
// process
double
process
=
(
1.0
*
(
i
+
1
)
/
fileNameList
.
size
())
*
100
;
double
process
=
(
1.0
*
(
i
+
1
)
/
fileNameList
.
size
())
*
100
;
printf
(
"%s done! %f
%
\n
"
,
GetFileName
(
fileNameList
[
i
]).
c_str
(),
process
);
printf
(
"%s done! %f
\n
"
,
GetFileName
(
fileNameList
[
i
]).
c_str
(),
process
);
}
}
printf
(
"all done!(the number of files:%
d
)
\n
"
,
fileNameList
.
size
());
printf
(
"all done!(the number of files:%
zu
)
\n
"
,
fileNameList
.
size
());
return
true
;
return
true
;
...
...
Src/Utility/SimpleLog.h
View file @
efb0ea9f
...
@@ -141,7 +141,7 @@ inline LogTime GetTime()
...
@@ -141,7 +141,7 @@ inline LogTime GetTime()
SYSTEMTIME
systemTime
;
SYSTEMTIME
systemTime
;
GetLocalTime
(
&
systemTime
);
GetLocalTime
(
&
systemTime
);
char
temp
[
8
]
=
{
0
};
char
temp
[
12
]
=
{
0
};
sprintf
(
temp
,
"%04d"
,
systemTime
.
wYear
);
sprintf
(
temp
,
"%04d"
,
systemTime
.
wYear
);
currentTime
.
year
=
string
(
temp
);
currentTime
.
year
=
string
(
temp
);
sprintf
(
temp
,
"%02d"
,
systemTime
.
wMonth
);
sprintf
(
temp
,
"%02d"
,
systemTime
.
wMonth
);
...
...
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