automl / NASLib

NASLib is a Neural Architecture Search (NAS) library for facilitating NAS research for the community by providing interfaces to several state-of-the-art NAS search spaces and optimizers.
Apache License 2.0
528 stars 117 forks source link

This errors that occur when I validate the setup by running tests #170

Open SuperRui41 opened 1 year ago

SuperRui41 commented 1 year ago

Hope to get help. Some errors that occur when I execute the command : coverage run -m unittest discover -v, The test result is “Ran 81 tests in 247.720s,FAILED (failures=6, errors=18)”

  1. Six of the same errors as the following
    ======================================================================
    ERROR: test_get_config_from_args_default_bbo_bs (test_utils.UtilsTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/data/marui/NAS/NASLib-Develop/tests/test_utils.py", line 38, in test_get_config_from_args_default_bbo_bs
    self._test_get_config_from_args_default(config_type="bbo-bs")
    File "/data/marui/NAS/NASLib-Develop/tests/test_utils.py", line 71, in _test_get_config_from_args_default
    config_child = utils.get_config_from_args(config_type=config_type)
    File "/data/marui/NAS/NASLib-Develop/naslib/utils/__init__.py", line 205, in get_config_from_args
    value) if arg in config else eval(value)
    File "<string>", line 1, in <module>
    NameError: name 'v' is not defined
  2. Six of the AssertionErrors as the following
    ======================================================================
    FAIL: test_forward_pass_aux_head (test_nb301_search_space.NasBench301SearchSpaceTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/data/marui/NAS/NASLib-Develop/tests/test_nb301_search_space.py", line 120, in test_forward_pass_aux_head
    self.assertEqual(aux_out.shape, (3, 512, 8, 8))
    AssertionError: torch.Size([3, 256, 8, 8]) != (3, 512, 8, 8)
  3. Twelve of the RuntimeErrors as the following
    ======================================================================
    ERROR: test_feed_forward (test_hierarchical_search_space.HierarchicalDartsIntegrationTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/data/marui/NAS/NASLib-Develop/tests/test_hierarchical_search_space.py", line 50, in test_feed_forward
    logits = final_arch(data_train[0])
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
    File "/data/marui/NAS/NASLib-Develop/naslib/search_spaces/core/graph.py", line 410, in forward
    edge_output = edge_data.op.forward(x, edge_data=edge_data)
    File "/data/marui/NAS/NASLib-Develop/naslib/search_spaces/core/primitives.py", line 388, in forward
    return self.seq(x)
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/container.py", line 139, in forward
    input = module(input)
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 457, in forward
    return self._conv_forward(input, self.weight, self.bias)
    File "/data/marui/anaconda3/envs/naslib/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 454, in _conv_forward
    self.padding, self.dilation, self.groups)
    RuntimeError: Given groups=1, weight of size [64, 64, 3, 3], expected input[2, 3, 32, 32] to have 64 channels, but got 3 channels instead

    Are these errors normal ? Is there something wrong with my environment settings ? How should I resolve these errors ? Looking forward to everyone's response, thanks!

abhash-er commented 1 year ago

Hi @SuperRui41 ,

The tests in the main branch are currently old. Hence these errors are popping up. We are right now working to improve these tests. For now, I would recommend you ignore these errors till we work on a fix for this.