titu1994 / tf_SIREN

Tensorflow 2.0 implementation of Sinusodial Representation networks (SIREN)
MIT License
149 stars 26 forks source link

edit __int__ in SIRENInitializer to avoid model loading problem #8

Closed jackietung1219 closed 4 years ago

jackietung1219 commented 4 years ago

Sorry to bother again, there were some error occur (TypeError: init() got an unexpected keyword argument 'scale') when I loaded the model based on tf_siren. Now tf_siren can work without error on my machine after modified.

titu1994 commented 4 years ago

I don't get how you are getting model loading problems. I am able to load and save the model without issue in the example

jackietung1219 commented 4 years ago

Hi, I saved trained model in HDF5 format. This problem happened when I used "tf.keras.models.load.model" to load trained model. Also, I needed to define a custom object for "tf.keras.models.load.model".

I'm really sorry if I misunderstood something.

[image: image.png]

Somshubra Majumdar notifications@github.com 於 2020年7月13日 週一 下午11:36寫道:

I don't get how you are getting model loading problems. I am able to load and save the model without issue in the example

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://mailtrack.io/trace/link/cf729449b8b0a0f563089dc067ea70d9a6383a2c?url=https%3A%2F%2Fgithub.com%2Ftitu1994%2Ftf_SIREN%2Fpull%2F8%23issuecomment-657632085&userId=4238406&signature=b4128b19a35892ab, or unsubscribe https://mailtrack.io/trace/link/7d8f7f9db8951b68c1fbb89926c922d8e88837e3?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKNXE3Y43YHNL3DO6KA2MWDR3MSWTANCNFSM4OYNOZZA&userId=4238406&signature=4ef0e6225cf931a8 .

titu1994 commented 4 years ago

The recommended way to save models in TF is using Saved Models, not HDFS.

jackietung1219 commented 4 years ago

Great! It solved all my problems, thanks a lot.

titu1994 commented 4 years ago

Glad I could help.