Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save model #174

Open
mohit-av opened this issue Feb 22, 2023 · 0 comments
Open

Unable to save model #174

mohit-av opened this issue Feb 22, 2023 · 0 comments

Comments

@mohit-av
Copy link

mohit-av commented Feb 22, 2023

I'm creating a model to decompress my image in TF using Conv2DTranspose and GDN layer. My architecture looks like this:

import os
import tensorflow as tf
from tensorflow_compression import layers
from tensorflow.keras.layers import Conv2DTranspose
from tensorflow.keras.models import Sequential
network_channels = 128
compression_channels = 192
in_channels = 3

gdn_layer_1 = layers.GDN(inverse=True, rectify=False, data_format = "channels_first") 
gdn_layer_2 = layers.GDN(inverse=True, rectify=False, data_format = "channels_first")
gdn_layer_3 = layers.GDN(inverse=True, rectify=False, data_format = "channels_first")
model = Sequential()
model.add(Conv2DTranspose(network_channels, (5, 5), strides = (2, 2), padding= 'same', output_padding = (1,1), data_format = 'channels_first', input_shape=( compression_channels, 1, 1)))
model.add(gdn_layer_1)
model.add(Conv2DTranspose(network_channels, (5, 5), strides = (2, 2), padding= 'same', output_padding = (1,1), data_format = 'channels_first'))
model.add(gdn_layer_2)
model.add(Conv2DTranspose(network_channels, (5, 5), strides = (2, 2), padding= 'same', output_padding = (1,1), data_format = 'channels_first'))
model.add(gdn_layer_3)
model.add(Conv2DTranspose(in_channels, (5, 5), strides = (2, 2), padding= 'same', output_padding = (1,1), data_format = 'channels_first'))
model.summary()

Screenshot 2023-02-22 at 9 55 13 AM

When I'm saving my model using the below command.

model.save(os.path.join("./tf_model"))

It's resulting in this issue:

Screenshot 2023-02-22 at 9 58 41 AM

My TF version is 2.11.0. I'm also attaching link to Colab Notebook to replicate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant