heaversm / deeplab-training

Training your own Deeplab Model in Tensorflow
37 stars 22 forks source link

Evaluation not working #5

Open AlexandraZajdel opened 4 years ago

AlexandraZajdel commented 4 years ago

Running train-pqr.sh doesn't cause any errors, the model is saved. But running eval-pqr.sh gives the error below:

I0422 13:24:17.127754 140272342116160 evaluation.py:450] Starting evaluation at 2020-04-22-11:24:17 <
2020-04-22 13:24:20.225281: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at spacetobatch_op.cc:219 : Invalid argument: padded_shape[1]=65 is not divisible by block_shape[1]=2
Traceback (most recent call last):
  File "/home/alexandra/Desktop/ABB/DeepLab_Tensorflow/.env/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/home/alexandra/Desktop/ABB/DeepLab_Tensorflow/.env/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/home/alexandra/Desktop/ABB/DeepLab_Tensorflow/.env/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: padded_shape[1]=65 is not divisible by block_shape[1]=2
         [[{{node xception_65/exit_flow/block2/unit_1/xception_module/separable_conv1_depthwise/depthwise/SpaceToBatchND}}]]

Before you ask, I've the same train_crop_size and eval_crop_size in the mentioned scripts.

ankitksharma commented 4 years ago

@AleksandraPestka I'm also facing the same issue. Were you able to resolve this?

AlexandraZajdel commented 4 years ago

@ankitksharma No, unfortunately

ankitksharma commented 4 years ago

@AleksandraPestka I wrote an export script which basically writes frozen_inference_graph.pb which you can use in demo_script. I hope it will be of help to you

python "${WORK_DIR}"/export_model.py \
  --checkpoint_path="${TRAIN_LOGDIR}/model.ckpt-500000" \
  --export_path="${TRAIN_LOGDIR}/frozen_inference_graph.pb" \
  --model_variant="mobilenet_v2" \
  --num_classes=2 \
  --atrous_rates=6 \
  --atrous_rates=12 \
  --atrous_rates=18 \
  --output_stride=16 \
  --decoder_output_stride=4 \
  --train_crop_size=256 \
  --train_crop_size=256 \
  --crop_size=256 \
  --crop_size=256 \
  --inference_scales=1.0 \
  --save_inference_graph=true