zhixuhao / unet

unet for image segmentation
MIT License
4.6k stars 2k forks source link

Migrating from keras to tf.keras #211

Open annanurov opened 4 years ago

annanurov commented 4 years ago

I'm using tf.keras (with TF2), instead of keras standalone library since TF2 integrates better. So I had to make a few fixes: import keras.foo becomes import tf.keras.foo

and

Model(input = my_input, output = my_output) becomes Model(inputs = my_input, outputs = my_output)

Otherwise, it's a great implementation. Many thanks 非常谢!

Asuna88 commented 3 years ago

I'm using tf.keras (with TF2), instead of keras standalone library since TF2 integrates better. So I had to make a few fixes: import keras.foo becomes import tf.keras.foo

and

Model(input = my_input, output = my_output) becomes Model(inputs = my_input, outputs = my_output)

Otherwise, it's a great implementation. Many thanks 非常谢!

我也发现了这个问题,在model.py脚本56行处,需要更正为 model = Model(inputs = inputs, outputs = conv10) 这样才运行正确。

感谢