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

GraphBuilder#removeVertex(name, true) fails for new GraphBuilder #6565

Closed
DrChainsaw opened this issue Oct 11, 2018 · 1 comment

Comments

@DrChainsaw
Copy link

commented Oct 11, 2018

The following testscase fails on 1.0.0-beta2:

@Test
public void testAddRemoveVertex() {
    new NeuralNetConfiguration.Builder().graphBuilder()
            .addVertex("toRemove", new ScaleVertex(0), "don't care")
            .addVertex("test", new ScaleVertex(0), "toRemove")
            .removeVertex("toRemove", true);
}

Reason is that Arrays.asList(vertexInputs) or (Collections.singletonList in case a merge vertex is created) is used to create the list of vertex inputs and those lists are immutable. Remove vertex with removeConnections will remove the given vertex name from all vertexes which has it as input.

The reason why this works from e.g. TransferLearning API is that a new ArrayList is used to copy the list of inputs in ComputationGraphConfiguration#clone

@AlexDBlack AlexDBlack self-assigned this Oct 12, 2018

AlexDBlack added a commit that referenced this issue Oct 15, 2018
Misc DL4J/Nd4J fixes (#6581)
* #6565 Fix GraphBuilder.removeVertex for non-modifiable lists

* #6562 fix Cnn3DLossLayer javadoc

* #6512 OldSoftMax validation for invalid rank inputs

* #6493 Warn users about delayed exceptions with CUDA grid executioner

* #6493 Warn users about delayed exceptions with CUDA grid executioner
@lock

This comment has been minimized.

Copy link

commented Nov 14, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 14, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.