-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ran for 200 epochs batch size 32 on brats18 #43
Comments
Hello @CraigMyles, model.save('model.h5') to save the model. from keras.models import load_model
model = load_model('model.h5') |
To get predictions on a test image, you can use model.predict(img) Where |
FYI:
This will not work due to custom loss function. I had to save weights and rebuild the model. Let me know if there is a better way. |
This works actually. At least it used to in TensorFlow 1.x. |
Thanks. Here's what I tried: Get hung up on the following error: AttributeError Traceback (most recent call last) 8 frames /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile) /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/saving/model_config.py in model_from_config(config, custom_objects) /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/layers/serialization.py in deserialize(config, custom_objects) /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name) /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/engine/network.py in from_config(cls, config, custom_objects) /tensorflow-1.15.2/python3.6/tensorflow_core/python/keras/engine/network.py in process_node(layer, node_data) /usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py in call(self, inputs, **kwargs) /usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py in _collect_previous_mask(input_tensors) AttributeError: 'Node' object has no attribute 'output_masks' |
Hmm, weird. Haven't seen that error before. Will try to look into it. In the meantime, if you manage to solve it, please do share the solution here. |
I noticed that I couldn't get the collab to work due to a tensorflow error however I tried to run it locally and was able to modify the notebook to run it as a python script.
I initially ran with default setting and this was my output:
https://gist.github.com/CraigMyles/12800936b55830d92aaf6a4b7bbb913e
I then ran with 200 epochs and batch size 32. and I got the following results:
https://gist.github.com/CraigMyles/f69392cba910accacbd45fc378a4474f
Epoch 200/200
4/4 [==============================] - 51s 13s/step - loss: 0.0225 - Dec_GT_Output_loss: 0.0000e+00 - Dec_VAE_Output_loss: 0.0225 - Dec_GT_Output_dice_coefficient: 0.0000e+00 - Dec_VAE_Output_dice_coefficient: 0.8982
I just have a few questions regarding the model and how it works, I noticed that with other segmentation models, once you have trained it, you have a weighted model which can be used against a testing set however I don't see this to be the case here?
Also I was wondering if possible how I would be able to get results in the form of jpg or png images that I would be able to turn into a gif.
Any advice or explanation would be great
The text was updated successfully, but these errors were encountered: