question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query on segmentation modeling (deeplabv3)

See original GitHub issue
  1. In general, shouldn’t the input size and target size match? Why I need to downscale the target samples for training? For example, input size 128, target size 32.
  2. I got the following warning message. Tested on colab.

WARNING:tensorflow:Gradients do not exist for variables [‘deep_lab_v3/feature_pyramid/output_P3/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P3/bias:0’, ‘deep_lab_v3/feature_pyramid/output_P4/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P4/bias:0’, ‘deep_lab_v3/feature_pyramid/output_P5/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P5/bias:0’] when minimizing the loss. If you’re using model.compile(), did you forget to provide a loss argument?

  1. mixed precision makes loss value to nan (probably need to cast the output of segmentation head to tf.float32. You might want to introduce dtype param in here.)

Reproducible Code.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
qlzh727commented, Oct 4, 2022

Thanks for the information. Note that for the accuracy, it might because the backbone we current use doesn’t have the pretrained weights, whereas the tutorial does use the keras application model with imagenet weights.

1reaction
qlzh727commented, Oct 3, 2022

Thanks for the question.

  1. In general, shouldn’t the input size and target size match? Why I need to downscale the target samples for training? For example, input size 128, target size 32.

Sure. Currently the model is just return the raw output from detection head. We could add extra layers to scale up the output to let it match the input shape. (for better comparison).

  1. I got the following warning message. Tested on colab.

WARNING:tensorflow:Gradients do not exist for variables [‘deep_lab_v3/feature_pyramid/output_P3/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P3/bias:0’, ‘deep_lab_v3/feature_pyramid/output_P4/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P4/bias:0’, ‘deep_lab_v3/feature_pyramid/output_P5/kernel:0’, ‘deep_lab_v3/feature_pyramid/output_P5/bias:0’] when minimizing the loss. If you’re using model.compile(), did you forget to provide a loss argument?

Let me take a closer look. I guess the FPN weights is not tracked by model correctly. Thanks for the report.

  1. mixed precision makes loss value to nan (probably need to cast the output of segmentation head to tf.float32. You might want to introduce dtype param in here.)

Thanks. Will do.

Reproducible Code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Document Segmentation using DeepLabV3 Semantic ...
We will be using DeepLabv3 semantic segmentation architecture to train a Document Segmentation model on a custom dataset. LearnOpenCV.
Read more >
Semantic Segmentation using a Django API — DeepLabV3
Segmentation models use fully convolutional neural networks FCNN during ... The API backend handles querying the database and formatting the ...
Read more >
How DeepLabV3 Works | ArcGIS API for Python
The DeepLab model addresses this challenge by using Atrous convolutions and Atrous Spatial Pyramid Pooling (ASPP) modules. This architecture has evolved over ...
Read more >
DeepLabV3, segmentation and classification/detection on coral
I see that it assigns labels to colors - how do i associate the labels.txt file that I made based off of the...
Read more >
Training a machine learning model on your own dataset with ...
Build a Deep CNN Image Classifier with ANY Images · Human Image Segmentation with DeepLabV3+ in TensorFlow 2.5. · DeepLab v3+ paper walkthrough....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found