How to output model.summary() as string?

49 views
Skip to first unread message

clar...@gmail.com

unread,
Mar 26, 2022, 8:16:50 PM3/26/22
to User Group for BigDL and Analytics Zoo
Hi BigDL/Zoo team,

Is there a way to capture the output of model.summary() as string, such that I can save it to a file in python? I tried (1) using python function contextlib.redirect_stdout() and also (2) directing sys.stdout to io.String(), but neither works, so I wonder if there is any existing methods for that.

(The trials above are based on the StackOverflow thread: Can I redirect the stdout into some sort of string buffer?)

Thanks for your help in advance!

Clare

Wang, Yang3

unread,
Mar 27, 2022, 10:19:32 PM3/27/22
to clar...@gmail.com, User Group for BigDL and Analytics Zoo

Hi Clare,

 

Would you mind sharing which’s the exact class of your “model”?

 

-Yang

--
You received this message because you are subscribed to the Google Groups "User Group for BigDL and Analytics Zoo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigdl-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigdl-user-group/63691eb0-19c4-4fa5-b58b-d5f2628c410cn%40googlegroups.com.

clar...@gmail.com

unread,
Mar 27, 2022, 10:26:40 PM3/27/22
to User Group for BigDL and Analytics Zoo
Yang,

Thanks for getting back. I am using the interface of zoo.pipeline.api.keras.models.

Please let me know if there is more information I shall provide.

Thank you,

Clare

Wang, Yang3

unread,
Mar 28, 2022, 4:08:40 AM3/28/22
to clar...@gmail.com, User Group for BigDL and Analytics Zoo

Hi Clare,

 

I am afraid that currently there are no existing methods for this.

 

We are working on adding this feature to BigDL-DLlib, since our future development has moved to the BigDL project as announced in the previous group email. We recommend you migrate to BigDL 2.0.

 

You can check out the document in here DLlib User Guide — BigDL documentation. The migration should be easy with no more than a few “import” code changes.

 

We will let you know as soon as the feature has been added.

 

Thanks,

clar...@gmail.com

unread,
Mar 28, 2022, 1:09:18 PM3/28/22
to User Group for BigDL and Analytics Zoo
Hi Yang,

Thanks for the information! Please keep me updated when the feature is added.

All the best,

Clare

Wang, Yang3

unread,
Apr 13, 2022, 10:57:33 PM4/13/22
to clar...@gmail.com, User Group for BigDL and Analytics Zoo

Hi Clare,

 

We have added the feature to return a string when calling model.summary in bigdl-dllib.

 

You can install the latest nightly build version by “pip install –pre bigdl-dllib” and you can use “bigdl.dllib.keras.models.Model.summary()” to return the model summary string.

 

Regards,

clar...@gmail.com

unread,
Oct 6, 2022, 2:36:52 PM10/6/22
to User Group for BigDL
Hi Yang,

Thanks for the update! (Sorry that I missed your message in previous months..) I wonder if this is already included in the newest release?

Than you again for answering my questions,

Clare

clar...@gmail.com

unread,
Oct 6, 2022, 2:54:17 PM10/6/22
to User Group for BigDL
Hi Yang,

Sorry I missed something in my question above - is the Model summary included in both the Keras API and DLLib for the current release? 

Thanks a lot,

Clare

Wang, Yang3

unread,
Oct 6, 2022, 8:04:10 PM10/6/22
to clar...@gmail.com, User Group for BigDL

Hi Clare,

 

We have added the bigdl.dllib.keras.models.Model.summary() support in the latest release.

--
You received this message because you are subscribed to the Google Groups "User Group for BigDL" group.


To unsubscribe from this group and stop receiving emails from it, send an email to bigdl-user-gro...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages