question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Layer names duplicated with multiple image inputs

See original GitHub issue

Bug Description

When multiple ImageBlocks are used in the same model, the layer names they generate are not unique, so the model does not build.

Bug Reproduction

input_node1 = ak.ImageInput()
input_node2 = ak.ImageInput()
output_node1 = ak.ImageBlock(augment=False)(input_node1)
output_node2 = ak.ImageBlock(augment=False)(input_node2)
merged = ak.Merge()([output_node1, output_node2])
output_node = ak.ClassificationHead()(merged)
clf = ak.AutoModel(
    inputs=[input_node1, input_node2],
    outputs=output_node,
    overwrite=True,
    max_trials=5)

Expected Behavior

The model should build. Instead:

ValueError: The name "conv1_pad" is used 2 times in the model. All layer names should be unique.

Setup Details

Include the details about the versions of:

  • OS type and version: Colab
  • Python: 3.6
  • autokeras: 1.0.3
  • keras-tuner: 1.0.2rc0
  • scikit-learn: 0.22.2.post1
  • numpy: 1.18.5
  • pandas: 1.0.5
  • tensorflow: 2.2.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:5

github_iconTop GitHub Comments

2reactions
rakshith291commented, Jan 7, 2021

Renaming the layers in the following way solved the problem for me.

for layer in model_con_1.layers : layer._name = layer.name + str(‘_1’) for layer in model_con_2.layers : layer._name = layer.name + str(‘_2’)

0reactions
abe-martincommented, Mar 7, 2022

Bump on this one. Is it possible to use multiple image inputs with AutoModel? I see that rakshith291 posted some code to rename layers, but where does that go, somewhere in the source of the fit function?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Several Image Inputs to same ResNet Resulting in ...
When using model.fit() , in my experience it is always better to have a single input, not a list. Later, manually index the...
Read more >
Error: Duplicate inputs are not allowed - Esri Support
Access the Layer Properties dialog box by either double-clicking the layer's name, or by right-clicking the layer and selecting Properties.
Read more >
A Scalable Solution to Detect Duplicate Images | MLearning.ai
There could be many reasons, but let me list a few reasons for ... you are feeding the image data into the convolutional...
Read more >
Duplicated Features in point layer - GIS Stack Exchange
The script will create a copy of your input fc so your input will ... to be duplicates matchlimit=0.90 #Name match limit namefield='Name' ......
Read more >
Solved: Re: Creating duplicate images for multi-packs on O ...
Version 1.3 was updated to work with vector layer content. Version 1.2 includes the ... PNG versions are saved to the same location...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found