forked from huawei/mindspore2022
Fix CI report bug & inference segmentation fault bug
This commit is contained in:
parent
c85f1bd7a2
commit
5c4a9d3404
|
|
@ -199,10 +199,17 @@ else
|
|||
cd ${PACKAGE} || exit 1
|
||||
echo "======Training Locally========="
|
||||
./train.sh ${EPOCHS}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Training Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "===Evaluating trained Model====="
|
||||
./eval.sh
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Eval Model failed"
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
fi
|
||||
END=$(date +%s.%N)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,10 @@ if [ "$MNIST_DATA_PATH" == "" ] || [ ! -d "$MNIST_DATA_PATH" ]; then
|
|||
fi
|
||||
|
||||
./build.sh $TARBALL
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "build failed on $TARBALL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASEPATH=$(cd "$(dirname $0)" || exit; pwd)
|
||||
|
||||
|
|
|
|||
|
|
@ -140,12 +140,24 @@ else
|
|||
cd ${PACKAGE} || exit 1
|
||||
echo "==Evaluating Untrained Model==="
|
||||
./eval_untrained.sh
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Evaluating Untrained Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "======Training Locally========="
|
||||
./train.sh
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Training Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "===Evaluating trained Model====="
|
||||
./eval.sh
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Eval Model failed"
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -175,12 +175,24 @@ else
|
|||
cd ${PACKAGE} || exit 1
|
||||
echo "======Training Locally========="
|
||||
./train.sh ${EPOCHS}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Training Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "===Evaluating trained Model====="
|
||||
./eval.sh
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Eval Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "====Running Inference Model====="
|
||||
./infer.sh
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Running Inference Model failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -16,3 +16,7 @@
|
|||
|
||||
# an simple tutorial as follows, more parameters can be setting
|
||||
LD_LIBRARY_PATH=./lib/ bin/infer -f model/lenet_tod_infer.ms
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Infer failed"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ int main(int argc, char **argv) {
|
|||
std::cout << "]" << std::endl;
|
||||
}
|
||||
|
||||
inputs.at(0).MutableData();
|
||||
mindspore::MSTensor *input_tensor = inputs.at(0).Clone();
|
||||
auto *input_data = reinterpret_cast<float *>(input_tensor->MutableData());
|
||||
std::ifstream in;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
source ./scripts/base_functions.sh
|
||||
version=1.3.0
|
||||
version=1.5.0
|
||||
|
||||
# Run Export on x86 platform and create output test files:
|
||||
docker_image=mindspore_build:210301
|
||||
|
|
@ -412,6 +412,10 @@ function Run_CodeExamples() {
|
|||
cd ${basepath}/../../examples/train_lenet_java || exit 1
|
||||
chmod 777 ./prepare_and_run.sh
|
||||
./prepare_and_run.sh -D ${datasets_path}/mnist -r ${tarball_path} -m ${models_path}/code_example.mindir >> ${run_code_examples_log_file}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "train_lenet_java prepare_and_run.sh failed"
|
||||
exit 1
|
||||
fi
|
||||
accurate=$(tail -10 ${run_code_examples_log_file} | awk -F= 'NF==2 && /accuracy/ { sum += $2} END { print (sum > 0.80) }')
|
||||
if [ $accurate -eq 1 ]; then
|
||||
echo "Lenet Java Trained and reached accuracy" >> ${run_code_examples_log_file}
|
||||
|
|
@ -431,6 +435,10 @@ function Run_CodeExamples() {
|
|||
chmod 777 ./prepare_and_run.sh
|
||||
chmod 777 ./*/*.sh
|
||||
./prepare_and_run.sh -D ${datasets_path}/mnist -r ${tarball_path} -t ${target} -m ${models_path}/code_example.mindir -e 1 >> ${run_code_examples_log_file}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Unified API prepare_and_run.sh failed"
|
||||
exit 1
|
||||
fi
|
||||
accurate=$(tail -20 ${run_code_examples_log_file} | awk 'NF==3 && /Accuracy is/ { sum += $3} END { print (sum > 1.6) }')
|
||||
if [ $accurate -eq 1 ]; then
|
||||
echo "Unified API Trained and reached accuracy" >> ${run_code_examples_log_file}
|
||||
|
|
@ -451,6 +459,10 @@ function Run_CodeExamples() {
|
|||
chmod 777 ./prepare_and_run.sh
|
||||
chmod 777 ./*/*.sh
|
||||
./prepare_and_run.sh -D ${datasets_path}/mnist -r ${tarball_path} -t ${target} -m ${models_path}/code_example.mindir -e 1 >> ${run_code_examples_log_file}
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "train_lenet prepare_and_run.sh failed"
|
||||
exit 1
|
||||
fi
|
||||
accurate=$(tail -10 ${run_code_examples_log_file} | awk 'NF==3 && /Accuracy is/ { sum += $3} END { print (sum > 1.6) }')
|
||||
if [ $accurate -eq 1 ]; then
|
||||
echo "Lenet Trained and reached accuracy" >> ${run_code_examples_log_file}
|
||||
|
|
|
|||
Loading…
Reference in New Issue