第十二周-----CityScapes尝试

主要想使用CityScapes尝试目标检测以及语义分析,但是最终出现很多没有见到过的问题,弄起来非常地麻烦。

根据教程下载了数据集以及models 

教程

由于使用的是windows环境所以只能尝试的使用。

但是在 sh convert_cityscapes.sh 时出现问题,找不到指定模块。解决:(首先看一下convert_cityscapes.sh文件内容

#!/bin/bash
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
#
# Script to preprocess the Cityscapes dataset. Note (1) the users should
# register the Cityscapes dataset website at
# https://www.cityscapes-dataset.com/downloads/ to download the dataset,
# and (2) the users should download the utility scripts provided by
# Cityscapes at https://github.com/mcordts/cityscapesScripts.
#
# Usage:
#   bash ./preprocess_cityscapes.sh
#
# The folder structure is assumed to be:
#  + datasets
#    - build_cityscapes_data.py
#    - convert_cityscapes.sh
#    + cityscapes
#      + cityscapesscripts (downloaded scripts)
#      + gtFine
#      + leftImg8bit
#

# Exit immediately if a command exits with a non-zero status.
set -e

CURRENT_DIR=$(pwd)
WORK_DIR="."

# Root path for Cityscapes dataset.
CITYSCAPES_ROOT="F:/ModelArts/cityscapesScripts"   #指定你的Cityscapes文件夹

# Create training labels.
python "${CITYSCAPES_ROOT}/cityscapesscripts/preparation/createTrainIdLabelImgs.py"  #根据上面文件夹可以运行这个py文件

# Build TFRecords of the dataset.
# First, create output directory for storing TFRecords.
OUTPUT_DIR="${CITYSCAPES_ROOT}/tfrecord"       #指定记得输出文件(tfrecord)
mkdir -p "${OUTPUT_DIR}"              #创建文件夹

BUILD_SCRIPT="${CURRENT_DIR}/build_cityscapes_data.py"    #运行这个py文件(这个py文件会在tfredord文件夹中产生训练模型)

echo "Converting Cityscapes dataset..."
python "${BUILD_SCRIPT}" \
  --cityscapes_root="${CITYSCAPES_ROOT}" \
  --output_dir="${OUTPUT_DIR}" \

在createTrainIdLabelImgs.py中出现找不到指定模块

https://www.cnblogs.com/birdmmxx/p/12905360.html

 

 在运行就不会有问题了。

posted @ 2020-05-10 23:20  birdmmxx  阅读(348)  评论(0编辑  收藏  举报