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

network model depends on the input size #10

Open
guoyejun opened this issue Jul 5, 2018 · 1 comment
Open

network model depends on the input size #10

guoyejun opened this issue Jul 5, 2018 · 1 comment

Comments

@guoyejun
Copy link

guoyejun commented Jul 5, 2018

Hi,

i'm trying to use this method in a c program which invokes tensorflow C API, so my way is to first save the network model in python program:
graph = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ["y"])
tf.train.write_graph(graph, '.', 'graph.pb', as_text=False)

But, the saved network model depends on the size of the input image, due to the following code which requires output_shape. It means we have to prepare a model file (130M+) for each possible input size. IMHO, both conv and deconv are not depend on the size of the input image.

network = tl.layers.DeConv2dLayer(input_layer,
                            shape = [filter_size, filter_size, num_out_channels, num_in_channels],
                            output_shape = [sz[0], sz[1]*scale, sz[2]*scale, num_out_channels],
                            strides=[1, scale, scale, 1],
                            W_init=init_matrix,
                            padding='SAME',
                            act=tf.identity,
                            name=str)

Is there another API to be choosen? or we need to ask tensorflow to introduce a new API without output_shape but (sz[0], scale, num_out_channles)? thanks

@gabrieleilertsen
Copy link
Owner

Hi! And sorry for the late reply. I'm afraid that I'm unable to help you. I have no experience with tensorflow in C, but it indeed seems limiting that an exported model is tied to a specific resolution. Since the model describes a fully convolutional network, it would should be able to take different resolutions.

I'll leave this issue open, in case someone else can help with the problem.

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

2 participants