Commit efb0ea9f authored by yangql's avatar yangql
Browse files

增加对dtk24.04.1的支持,以及对k100_AI的支持。

parent 1b47efb3
...@@ -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})
......
...@@ -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-dtk22.10.1 docker pull image.sourcefind.cn:5000/dcu/admin/base/migraphx:4.3.0-ubuntu20.04-dtk24.04.1-py3.10
``` ```
创建并启动容器: 创建并启动容器:
``` ```
docker run --shm-size 16g --network=host --name=resnet50_ort --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_onnxruntime -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_ort --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_onnxruntime -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
``` ```
## 数据集 ## 数据集
......
#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
......
...@@ -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;
......
...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment