Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

GPTuner does not support string choices #1546

Closed
mys007 opened this issue Sep 13, 2019 · 2 comments
Closed

GPTuner does not support string choices #1546

mys007 opened this issue Sep 13, 2019 · 2 comments
Assignees
Labels

Comments

@mys007
Copy link

mys007 commented Sep 13, 2019

Short summary about the issue/question:

GPTuner raises an exception when search space contains a choice over strings:

{
    ....
    "model_config": {"_type": "choice", "_value": ["A", "B"]}
}
......
  File "/home/xxx/miniconda3/envs/spur/lib/python3.7/site-packages/nni/tuner.py", line 52, in generate_multiple_parameters
    res = self.generate_parameters(parameter_id, **kwargs)
  File "/home/xxx/miniconda3/envs/spur/lib/python3.7/site-packages/nni/gp_tuner/gp_tuner.py", line 101, in generate_parameters
    results = self._space.random_sample()
  File "/home/xxx/miniconda3/envs/spur/lib/python3.7/site-packages/nni/gp_tuner/target_space.py", line 180, in random_sample
    _bound['_value'], self.random_state)
ValueError: could not convert string to float: 'A'

This is caused by https://github.com/microsoft/nni/blob/master/src/sdk/pynni/nni/gp_tuner/target_space.py#L176, which enforces float types. I believe replacing the line with params = []*self.dim could solve the issue?

nni Environment:

  • nni version: 1.0
  • nni mode(local|pai|remote): local
  • OS: Ubuntu
  • python version: 3.7
  • is conda or virtualenv used?: conda
  • is running in docker?: no
@scarlett2018
Copy link
Member

@mys007 - Thanks for raising the problem, this is a known limitation, our current GPTuner reference implementation only support choice for integer and float. @suiguoxin will update the document to let users know about this limitation.

@scarlett2018 scarlett2018 added the documentation documentation related issues label Sep 16, 2019
@rabbit008
Copy link
Contributor

#1551 add doc for GP-Tuner: support only numerical values

suiguoxin added a commit that referenced this issue Sep 18, 2019
* add doc & err catch for gp-tuner: support only numerical values
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants