Skip to content

Errors in read/write of Config Space with Forbidden and Condition clauses #110

@Neeratyoy

Description

@Neeratyoy

Hello,

This is similar to the open issue #79.
Some more observations.
Initially had trouble writing to JSON, however, with the latest release that looks fine.
I am still unable to write to PCS using pcs_new.write getting an error:
TypeError: sequence item 0: expected str instance, int found

Also, I tried to run the source code manually and observed the following:
[amsgrad | model_optimizer == 'adam',
momentum | model_optimizer == 'sgd',
channel_2 | n_conv_layer in {2, 3},
channel_3 | n_conv_layer == 3,
kernel_2 | n_conv_layer in {2, 3},
kernel_3 | n_conv_layer == 3,
padding_2 | n_conv_layer in {2, 3},
padding_3 | n_conv_layer == 3,
stride_2 | n_conv_layer in {2, 3},
stride_3 | n_conv_layer == 3,
(maxpool_2 | n_conv_layer in {2, 3} && maxpool_2 | stride_2 != 2),
(maxpool_3 | n_conv_layer in {2, 3} && maxpool_3 | stride_3 != 2),
(maxpool_kernel_2 | n_conv_layer in {2, 3} && maxpool_kernel_2 | maxpool_2 == 'True'),
(maxpool_kernel_3 | n_conv_layer in {2, 3} && maxpool_kernel_3 | maxpool_3 == 'True'),
maxpool_1 | stride_1 != 2,
maxpool_kernel_1 | maxpool_1 == 'True']

On running the conditional clauses with IN, such as
padding_2 | n_conv_layer in {2, 3}
stride_3 | n_conv_layer == 3
with condition_lines.write(build_condition(condition)) gives the following error:

TypeError Traceback (most recent call last)
in ()
----> 1 condition_lines.write(build_condition(condition))
in build_condition(condition)
133 return in_template % (condition.child.name,
134 condition.parent.name,
--> 135 ", ".join(condition.values))
136
137 elif isinstance(condition, EqualsCondition):
TypeError: sequence item 0: expected str instance, int found

On running the forbidden clauses with IN, such as
(maxpool_3 | n_conv_layer in {2, 3} && maxpool_3 | stride_3 != 2)
(maxpool_kernel_2 | n_conv_layer in {2, 3} && maxpool_kernel_2 | maxpool_2 == 'True')
with condition_lines.write(build_conjunction(condition)) gives the following error:

AttributeError Traceback (most recent call last)
in ()
----> 1 condition_lines.write(build_conjunction(condition))
in build_conjunction(conjunction)
153
154 cond_list = list()
--> 155 for component in conjunction.components:
156 tmp = build_condition(component.get_descendant_literal_conditions()[0])
157
AttributeError: 'ConfigSpace.conditions.NotEqualsCondition' object has no attribute 'components'

I believe a similar issue might also exist with the pcs_new.read since CAVE runs fail to read any configspace file with such cases.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions