78 Star 600 Fork 1.2K

Ascend/pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
libtorch_resnet.sh 636 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
py_execute=${1-python3}
CUR_DIR=$(dirname $(readlink -f $0))
cd ${CUR_DIR}/../examples/libtorch_resnet
if [ -f ./resnet_model.pt ]; then
rm ./resnet_model.pt
fi
$py_execute resnet_trace.py
if [ $? != 0 ]; then
echo "Failed to trace resnet model."
exit 1
fi
if [ -d "build" ]; then
rm -rf ./build
fi
mkdir build && cd build && \
cmake -DCMAKE_PREFIX_PATH=`$py_execute -c 'import torch;print(torch.utils.cmake_prefix_path)'` .. && \
make && ./libtorch_resnet ../resnet_model.pt > out.log
if grep -q "resnet_model run success!" out.log; then
echo "Success."
exit 0
else
echo "Failed."
exit 1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ascend/pytorch.git
git@gitee.com:ascend/pytorch.git
ascend
pytorch
pytorch
master

搜索帮助