GithubHelp home page GithubHelp logo

How can I load model? about fgsegnet_v2 HOT 5 CLOSED

lim-anggun avatar lim-anggun commented on July 30, 2024
How can I load model?

from fgsegnet_v2.

Comments (5)

lim-anggun avatar lim-anggun commented on July 30, 2024 2

hi @Wisgon,
there is an InstanceNormalization file inside the scripts folder. What you need to do is:

  1. Copy and paste instance_normalization.py into the same folder as Jupyter Notebook
  2. load the model as following (I did't test yet, but hope it works):
# ... the rest of your code ...
from instance_normalization import InstanceNormalization
model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization})

Let me know if it works.

from fgsegnet_v2.

Wisgon avatar Wisgon commented on July 30, 2024 2

It works!
But, I found that I should add something else to make it work:

from FgSegNet_v2_module.py import loss2, acc2
model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D, 'InstanceNormalization': InstanceNormalization, 'loss2':loss2, 'acc2':acc2})

If you don't add loss2 and acc2, it will raise "Unknow loss function: loss2"

from fgsegnet_v2.

Wisgon avatar Wisgon commented on July 30, 2024

Ahha, I found https://github.com/lim-anggun/FgSegNet/blob/master/test_prediction.ipynb
Closing the issue.

from fgsegnet_v2.

Wisgon avatar Wisgon commented on July 30, 2024

I use model = load_model(mdl_path, custom_objects={'MyUpSampling2D': MyUpSampling2D}) to load model, but it still raise "ValueError: Unknow layer: InstanceNormalization"

from fgsegnet_v2.

124399839 avatar 124399839 commented on July 30, 2024

@Wisgon 请问你在自己的数据上,该方法表现效果如何?

from fgsegnet_v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.