Tensorflow Hub – get input shape and problem domain for models?

you can get shape of input which model expects, from accessing first layer of the model, and accessing input_shape attribute of that layer

layers = model.layers
first_layer = layers[0] # usually the first layer is the input layer
print(first_layer.input_shape)

output:

[(None, 100, 100, 3)] # sample output

None -> this specifies the size of batch size, inference is that batch size can be anything you specify

(100, 100, 3) -> height, width and channels, can vary and input data you give should be strictly the same.

finding the domain of the trained model is little bit tricky through programming, you can plot the model’s graph using tensorflow.keras.util.plot_model and can infer domain from model’s architecture.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top