What is the top-level directory of the model you are using: deeplab
Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 Enterprise
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): 1.12.0
Bazel version (if compiling from source): N/A
CUDA/cuDNN version: 9
GPU model and memory: NVIDIA Quadro M4000, 8GB
Exact command to reproduce: Does not apply
Describe the problem
I posted this on Stack Overflow because I am not sure if this is a bug or if I am misusing the code. I have successfully trained my model on a custom dataset with 4 classes of size 480x640, with an xception65 encoder, using Deeplab. I am getting decent results on the validation set whenever I use the vis.py script:
However, I am not getting the same results on the same images when I freeze the model. I froze the model using export_model.py and successfully outputted a frozen_model.pb file. However, when I run inferences using this pb file, the outputs are always 0 (i.e. everything is classified as "background") on the same exact images I provided links to above. Everything is black!
I believe this to be an issue with how the model is exported, and not necessarily with the model itself because the performance on the images is different between running the vis.py script and my code for inference. However, if I am loading the model incorrectly please let me know. Perhaps I am not loading the graph or initializing the variables correctly. Or perhaps I'm not saving the weights correctly in the first place. Any help would be greatly appreciated!
Source code
And below is my code for exporting the model, using the provided export_model.py script.
System information
Describe the problem
I posted this on Stack Overflow because I am not sure if this is a bug or if I am misusing the code. I have successfully trained my model on a custom dataset with 4 classes of size 480x640, with an xception65 encoder, using Deeplab. I am getting decent results on the validation set whenever I use the
vis.py
script:However, I am not getting the same results on the same images when I freeze the model. I froze the model using
export_model.py
and successfully outputted a frozen_model.pb file. However, when I run inferences using this pb file, the outputs are always 0 (i.e. everything is classified as "background") on the same exact images I provided links to above. Everything is black!I believe this to be an issue with how the model is exported, and not necessarily with the model itself because the performance on the images is different between running the
vis.py
script and my code for inference. However, if I am loading the model incorrectly please let me know. Perhaps I am not loading the graph or initializing the variables correctly. Or perhaps I'm not saving the weights correctly in the first place. Any help would be greatly appreciated!Source code
And below is my code for exporting the model, using the provided
export_model.py
script.Below I provide my code for inference: