Keras: only display NN-architecture without model memory allocation

2 days ago 7
ARTICLE AD BOX

My goal is to use Keras to visualise the architecture of the model. No training, no inference.

For example if I just want to visualise the NN of the classic VGG16-model with model = create_vgg_like_model() Keras is starting to pre-allocate the memory needed and program crash.

enter image description here

I tried to play around with

cpu_devices = tf.config.experimental.list_physical_devices('CPU') if cpu_devices: try: tf.config.experimental.set_visible_devices(cpu_devices) tf.config.experimental.set_memory_growth(cpu_devices[0], True) except: pass

but without success.

Is there a way to post-pone the memory allocation?

Read Entire Article