ValueError: No such layer: P3
See original GitHub issueOne issue when I convert the train model to inference model:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-8c208d1cf44b> in <module>()
----> 1 inference_model = retinanet_bbox(model=model)
~/RCNN/keras-retinanet/keras_retinanet/models/retinanet.py in retinanet_bbox(model, anchor_parameters, nms, class_specific_filter, name, **kwargs)
335
336 # compute the anchors
--> 337 features = [model.get_layer(p_name).output for p_name in ['P3', 'P4', 'P5', 'P6', 'P7']]
338 anchors = __build_anchors(anchor_parameters, features)
339
~/RCNN/keras-retinanet/keras_retinanet/models/retinanet.py in <listcomp>(.0)
335
336 # compute the anchors
--> 337 features = [model.get_layer(p_name).output for p_name in ['P3', 'P4', 'P5', 'P6', 'P7']]
338 anchors = __build_anchors(anchor_parameters, features)
339
~/.conda/envs/21/lib/python3.6/site-packages/keras/engine/network.py in get_layer(self, name, index)
363 return layer
364
--> 365 raise ValueError('No such layer: ' + name)
366
367 @property
ValueError: No such layer: P3
However, in retinanet.py __create_pyramid_features(C3, C4, C5, feature_size=256)
, we can find the codes already included the name='P3'
:
...
# add P4 elementwise to C3
P3 = keras.layers.Conv2D(feature_size, kernel_size=1, strides=1, padding='same', name='C3_reduced')(C3)
P3 = keras.layers.Add(name='P3_merged')([P4_upsampled, P3])
P3 = keras.layers.Conv2D(feature_size, kernel_size=3, strides=1, padding='same', name='P3')(P3)
...
Does anybody know what is going wrong? Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
No such layer - Extracting the output of a tensorflow keras layer
Value Error : No such layer - Extracting the output of a tensorflow keras layer · The variable name is thelayer not the...
Read more >Keras-io/Lobby - Gitter
Is there asyncio support for training and prediction using keras? ... get_layer raise ValueError('No such layer: ' + name) ValueError: No such layer:...
Read more >Raise ValueError(f'No such layer: {name}. Existing layers are
I am trying to run the following code but I get this error how can I resolve it """ Encoder """ s1 =...
Read more >Mobilenet Model with submission | Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from ... Conv2D(32, (3, 3), activation='relu', padding='same') (c3) p3 = layers....
Read more >A `Concatenate` layer should be called on a list of at least 2 ...
This error is coming because concatenate expects list of tensors to be concatenated. While you are passing graph and graph_1 which is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure if the multi-gpu model can easily be converted back to a non-multi-gpu model. What did you change in train.py? By default,
model
should be saved, which is the non-multi-gpu model even if you enable multi-gpu.excuse me ? can you tell me how to save the inference model?