tensorflow / tensorflow/models

Can't run vis.py on the given checkpoints without further training

Open
#9,447 3 comments 0 reactions 3 assignees View on GitHub

Nobody has claimed this yet.

models:research type:bug
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/cityscapes.md

2. Describe the bug

I want to run inference on DeepLab model pretrained on Cityscapes, to be more specific, I want to use xception65_cityscapes_trainfine checkpoint which has Xception_65 as Network Backbone, and its pretrained dataset are ImageNet and Cityscapes train_fine set. When I download this checkpoint and give it as the --checkpoint_dir for vis.py script, it doesn't load the model and produce outputs at all. Instead, it waits for a new checkpoint.

3. Steps to reproduce

  • Install DeepLab as described here
  • Download Cityscapes dataset and converting it to TFRecord using the script mentioned here
  • Download the checkpoint file from here.
  • Run the script below:
PATH_TO_CHECKPOINT="./deeplab/datasets/cityscapes/init_folder/deeplabv3_cityscapes_train/model.ckpt"
PATH_TO_VIS_DIR="./deeplab/datasets/cityscapes/exp/train_on_train_set/vis"
PATH_TO_DATASET="./deeplab/datasets/cityscapes/tfrecord"

# From tensorflow/models/research/
python deeplab/vis.py \
    --logtostderr \
    --vis_split="val_fine" \
    --model_variant="xception_65" \
    --atrous_rates=6 \
    --atrous_rates=12 \
    --atrous_rates=18 \
    --output_stride=16 \
    --decoder_output_stride=4 \
    --vis_crop_size="1025,2049" \
    --dataset="cityscapes" \
    --colormap_type="cityscapes" \
    --checkpoint_dir=${PATH_TO_CHECKPOINT} \
    --vis_logdir=${PATH_TO_VIS_DIR} \
    --dataset_dir=${PATH_TO_DATASET}

4. Expected behavior

Instead of waiting for a new checkpoint, I'm expecting this script to run inference with the test images on the pretrained network and save output images to ${PATH_TO_VIS_DIR}.

5. Additional context

I tried mobilenet_v2 variant as well, but same thing happened.

The main reason I'm trying to run the model without further training is, even when I try further training, miou I get is 0 for most of the classes, so I started to think that maybe I'm not able to use pretrained weights at all, so I wanted make sure, even without further training I'm getting some results with the pretrained weights, but I can't even run eval.py or vis.py.

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): pip install tensorflow-gpu==1.15.2
  • Python version: Python3
  • CUDA/cuDNN version: CUDA Version: 11.0 cuDNN 7.5.1
  • GPU model and memory: Tesla M60 7618GiB

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.