You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_process_data.sh 1.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # Copyright 2020 Huawei Technologies Co., Ltd
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ============================================================================
  16. if [ $# != 2 ]
  17. then
  18. echo "Usage: sh run_train.sh [SRC_PATH] [DATASET_NAME]"
  19. exit 1
  20. fi
  21. get_real_path(){
  22. if [ "${1:0:1}" == "/" ]; then
  23. echo "$1"
  24. else
  25. echo "$(realpath -m $PWD/$1)"
  26. fi
  27. }
  28. SRC_PATH=$(get_real_path $1)
  29. echo $SRC_PATH
  30. DATASET_NAME=$2
  31. echo $DATASET_NAME
  32. if [ ! -d data_mr ]; then
  33. mkdir data_mr
  34. else
  35. echo data_mr exist
  36. fi
  37. MINDRECORD_PATH=`pwd`/data_mr
  38. rm -f $MINDRECORD_PATH/*
  39. cd ../../utils/graph_to_mindrecord || exit
  40. python writer.py --mindrecord_script $DATASET_NAME \
  41. --mindrecord_file "$MINDRECORD_PATH/$DATASET_NAME" \
  42. --mindrecord_partitions 1 \
  43. --mindrecord_header_size_by_bit 18 \
  44. --mindrecord_page_size_by_bit 20 \
  45. --graph_api_args "$SRC_PATH"
  46. cd - || exit