question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"ValueError: Unknown layer: InstanceNormalization" while predicting (isensee2017)

See original GitHub issue

Hello, 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ellisdgcommented, Jan 10, 2018

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 the custom_objects dictionary. When loading the model this will tell Keras what exactly ‘InstanceNormalization’ is referring to.

0reactions
b-zcommented, Jan 30, 2018

Thanks a lot!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found