"ValueError: Unknown layer: InstanceNormalization" while predicting (isensee2017)
See original GitHub issueHello,
I have followed the readme to train the brats data using the method of isensee2017.
The training phrase worked well, but when performing python predict.py
, an error occurred
ValueError: Unknown layer: InstanceNormalization
at https://github.com/ellisdg/3DUnetCNN/blob/master/unet3d/prediction.py#L120
I’ve searched in Google but found no results, could you please give me some ideas?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ValueError: Unknown layer:name when loading a keras model
If you are using a custom layer, you can load a keras model with such a layer as follows: model = keras.models.load_model(model_path, ...
Read more >keras.models.load_model ValueError: Unknown layer
ValueError : Unknown layer: Functional. i'm using the following command in python: from tensorflow import keras.
Read more >ValueError: Unknown layer: InstanceNormalization - CSDN博客
ValueError : Unknown layer: InstanceNormalization使用keras的load_model出现如上错误使用keras的load_model出现如上错误原因是我们在训练模型的时候 ...
Read more >Error happening while loading pre-trained model - Kaggle
Error happening while loading pre-trained model. ... ValueError: Unknown layer: FixedDropout ... model_final = Model(base_model.input, predictions)
Read more >ValueError: Unknown layer: Custom>TFViTMainLayer when ...
I have a google's visual transformer model which I have trained in Tensorflow 2 and saved as an h5 file. # Base model...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has to do with the load_model function not understanding the Instance Normalization layer. I’ll try to fix this soon, but to fix it now this you can add
from keras-contrib import InstanceNormalization
to the training.py file and then in the load_model function add'InstanceNormalization': InstanceNormalization
to thecustom_objects
dictionary. When loading the model this will tell Keras what exactly ‘InstanceNormalization’ is referring to.Thanks a lot!