intel / unet

U-Net Biomedical Image Segmentation
Apache License 2.0
306 stars 125 forks source link

Converting Keras model to TF model. #4

Closed feichai2004 closed 5 years ago

feichai2004 commented 5 years ago

I tried to run the :CUDA_VISIBLE_DEVICES=None python3 convert_keras_to_tensorflow_serving_model.py". It gives the following error.

Loading saved Keras model. Traceback (most recent call last): File "convert_keras_to_tensorflow_serving_model.py", line 87, in "dice_coef": dice_coef, "dice_coef_loss": dice_coef_loss}) File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/engine/saving.py", line 419, in load_model model = _deserialize_model(f, custom_objects, compile) File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/engine/saving.py", line 312, in _deserialize_model sample_weight_mode=sample_weight_mode) File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/engine/training.py", line 139, in compile loss_function = losses.get(loss) File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/losses.py", line 133, in get return deserialize(identifier) File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/losses.py", line 114, in deserialize printable_module_name='loss function') File "/home/avx/venv/TF3_env/lib/python3.5/site-packages/keras/utils/generic_utils.py", line 165, in deserialize_keras_object ':' + function_name) ValueError: Unknown loss function:combined_dice_ce_loss

tonyreina commented 5 years ago

Thanks. Please check the update to see if it works.

feichai2004 commented 5 years ago

It is working now.