- Instead of the importKerasNetwork function, use the importTensorFlowNetwork function. The importTensorFlowNetwork function is the newest and recommended function. The importTensorFlowNetwork function generates a custom layer when you import a TensorFlow layer that the software cannot convert into an equivalent built-in MATLAB layer. Then, you will have a network that is ready to use. Note, that you must convert your TensorFlow model from .h5 format to SavedModel format to use the importTensorFlowNetwork function. For more information on the differences between importKerasNetwork and importTensorFlowNetwork functions, see Importing Models from TensorFlow, PyTorch, and ONNX.
- You can replace the placeholder layer with a resize2dLayer or resize3dLayer.
- You can replace the placeholder layer with your own custom layer.
Keras Network: Placeholder for 'BilinearUpSampling2D'
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
jose daniel hoyos giraldo
el 3 de Sept. de 2022
Comentada: Sivylla Paraskevopoulou
el 13 de Sept. de 2022
Hello, I'm trying to use a keras network for depth estimation from a monocular view.
I'm following this: https://www.mathworks.com/help/deeplearning/ref/importkerasnetwork.html
The problem is that when I try:
placeholderLayers = findPlaceholderLayers(lgraph)
I got layers of this type:
2 'up1_upsampling2d' PLACEHOLDER LAYER Placeholder for 'BilinearUpSampling2D' Keras layer
which I dont know how to deal with.
Thanks!
0 comentarios
Respuestas (1)
Sivylla Paraskevopoulou
el 6 de Sept. de 2022
Editada: Sivylla Paraskevopoulou
el 6 de Sept. de 2022
You have a few options:
2 comentarios
Sivylla Paraskevopoulou
el 13 de Sept. de 2022
The assembleNetwork function expects the assembled layers to include input and output layers. You can add layers by using the addLayers function.
Also, it looks like you are replacing the placeholder upsampling layers with gaussian noise layers. I don't think these two types of layers have the same functionality.
I still think it would be easier to convert your model from .h5 to SavedModel using Python and then import it by using the importTensorFlowNetwork function.
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!