tensorflow / tensorflow/models
[DeepLab] Inference with pre-trained model on test images
Open
@aquariusjay is already working on this.
Since Jun 23, 2020.
models:research
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
System information
- What is the top-level directory of the model you are using: /tensorflow/models/research/deeplab
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux 16.04
- TensorFlow installed from (source or binary): Bazel
- TensorFlow version (use command below): 1.12
- Bazel version (if compiling from source): N/A
- CUDA/cuDNN version: CUDA 10.0
- GPU model and memory: GeForce GTX 980 Ti
- Exact command to reproduce: deeplab/eval.py
I do not fully understand how to infer a pre-trained model (e.g. trained on Cityscapes data) on some road scene images.
Command I use:
python3.5 eval.py \
--logtostderr \
--eval_split="val" \
--model_variant="xception_65" \
--atrous_rates=6 \
--atrous_rates=12 \
--atrous_rates=18 \
--output_stride=16 \
--decoder_output_stride=4 \
--eval_crop_size="1025,2049" \
--dataset="cityscapes" \
--checkpoint_dir=/home/user/tensorflow/models/research/deeplab/datasets/deeplabv3_cityscapes_train/ \
--eval_logdir=/home/user/tensorflow/models/research/deeplab/OUTPUT \
--dataset_dir=/home/user/tensorflow/models/research/deeplab/datasets/test-data.tfrecord
the tfrecord file contains only image height, width, channels, filename, encoded image, image format.
-
Is the tfrecord data correct? I do not load any semantic images because I only want to run the inference, the semantic segmentation of some input images which I want to save.
-
Is the way how the eval.py is called correct?
Error code:
Traceback (most recent call last):
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flag.py", line 166, in _parse
return self.parser.parse(argument)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_argument_parser.py", line 152, in parse
val = self.convert(argument)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_argument_parser.py", line 265, in convert
return int(argument, base)
ValueError: invalid literal for int() with base 10: '1025,2049'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "eval.py", line 177, in <module>
tf.app.run()
File "/home/user/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 119, in run
argv = flags.FLAGS(_sys.argv if argv is None else argv, known_only=True)
File "/home/user/.local/lib/python3.5/site-packages/tensorflow/python/platform/flags.py", line 112, in __call__
return self.__dict__['__wrapped'].__call__(*args, **kwargs)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flagvalues.py", line 625, in __call__
unknown_flags, unparsed_args = self._parse_args(args, known_only)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flagvalues.py", line 761, in _parse_args
flag.parse(value)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flag.py", line 363, in parse
new_values = self._parse(arguments)
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flag.py", line 377, in _parse
return [super(MultiFlag, self)._parse(item) for item in arguments]
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flag.py", line 377, in <listcomp>
return [super(MultiFlag, self)._parse(item) for item in arguments]
File "/home/user/.local/lib/python3.5/site-packages/absl/flags/_flag.py", line 169, in _parse
'flag --%s=%s: %s' % (self.name, argument, e))
absl.flags._exceptions.IllegalFlagValueError: flag --eval_crop_size=1025,2049: invalid literal for int() with base 10: '1025,2049'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.