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

Tune: BayesOptSearch example from docs stops part-way through with "TypeError: 'float' object is not subscriptable" #25464

Closed
joseph-long opened this issue Jun 3, 2022 · 2 comments
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@joseph-long
Copy link

joseph-long commented Jun 3, 2022

What happened + What you expected to happen

Expected: Bayesian optimization example from the docs should run to completion

Observed: Example for BayesOptSearch runs for several iterations before it terminates with a TypeError deep in the guts of the framework

Logs:

2022-06-03 16:08:09,083	INFO services.py:1456 -- View the Ray dashboard at �[1m�[32mhttp://127.0.0.1:8265�[39m�[22m
2022-06-03 16:08:10,226	WARNING function_runner.py:598 -- Function checkpointing is disabled. This may result in unexpected behavior when using checkpointing features or certain schedulers. To enable, set the train function arguments to be `func(config, checkpoint_dir=None)`.
2022-06-03 16:08:10,229	WARNING bayesopt.py:415 -- BayesOpt does not support specific sampling methods. The Uniform sampler will be dropped.
2022-06-03 16:08:10,229	WARNING bayesopt.py:415 -- BayesOpt does not support specific sampling methods. The Uniform sampler will be dropped.
2022-06-03 16:08:10,418	INFO trial_runner.py:803 -- starting easy_objective_094d6026
2022-06-03 16:08:11,640	INFO trial_runner.py:803 -- starting easy_objective_0a218dd8
2022-06-03 16:08:11,648	INFO trial_runner.py:803 -- starting easy_objective_0a231efa
2022-06-03 16:08:11,654	INFO trial_runner.py:803 -- starting easy_objective_0a241f76
2022-06-03 16:08:12,926	INFO trial_runner.py:803 -- starting easy_objective_0ae604c4
2022-06-03 16:08:14,152	INFO trial_runner.py:803 -- starting easy_objective_0ba12830
2022-06-03 16:08:19,721	INFO trial_runner.py:803 -- starting easy_objective_0ef1f5e6
2022-06-03 16:08:21,060	INFO trial_runner.py:803 -- starting easy_objective_0fbee088
2022-06-03 16:08:22,266	INFO trial_runner.py:803 -- starting easy_objective_10773dfe
2022-06-03 16:08:22,753	INFO trial_runner.py:803 -- starting easy_objective_10c1597a
== Status ==
Current time: 2022-06-03 16:08:11 (running for 00:00:01.39)
Memory usage on this node: 24.4/64.0 GiB
Using AsyncHyperBand: num_stopped=0
Bracket: Iter 64.000: None | Iter 16.000: None | Iter 4.000: None | Iter 1.000: None
Resources requested: 1.0/10 CPUs, 0/0 GPUs, 0.0/36.26 GiB heap, 0.0/2.0 GiB objects
Result logdir: /Users/josephlong/ray_results/my_exp
Number of trials: 1/1000 (1 RUNNING)
+-------------------------+----------+-----------------+----------+---------+
| Trial name              | status   | loc             |   height |   width |
|-------------------------+----------+-----------------+----------+---------|
| easy_objective_094d6026 | RUNNING  | 127.0.0.1:58084 |  -25.092 | 19.0143 |
+-------------------------+----------+-----------------+----------+---------+


Result for easy_objective_094d6026:
  date: 2022-06-03_16-08-11
  done: false
  experiment_id: 4b2c7ba7a12d4431a3505103b2c5cf42
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 7.490802376947249
  neg_mean_loss: -7.490802376947249
  node_ip: 127.0.0.1
  pid: 58084
  time_since_restore: 8.7738037109375e-05
  time_this_iter_s: 8.7738037109375e-05
  time_total_s: 8.7738037109375e-05
  timestamp: 1654297691
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 094d6026
  warmup_time: 0.002312183380126953
  
Result for easy_objective_0a231efa:
  date: 2022-06-03_16-08-12
  done: false
  experiment_id: 5c2dfffd23d34887902f75bf6113b987
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 3.120372808848731
  neg_mean_loss: -3.120372808848731
  node_ip: 127.0.0.1
  pid: 58087
  time_since_restore: 8.392333984375e-05
  time_this_iter_s: 8.392333984375e-05
  time_total_s: 8.392333984375e-05
  timestamp: 1654297692
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0a231efa
  warmup_time: 0.0022521018981933594
  
Result for easy_objective_0a241f76:
  date: 2022-06-03_16-08-12
  done: false
  experiment_id: d04d3c1215504ddeb8ce2c681b797b15
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 1.1616722433639897
  neg_mean_loss: -1.1616722433639897
  node_ip: 127.0.0.1
  pid: 58088
  time_since_restore: 7.009506225585938e-05
  time_this_iter_s: 7.009506225585938e-05
  time_total_s: 7.009506225585938e-05
  timestamp: 1654297692
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0a241f76
  warmup_time: 0.0020360946655273438
  
Result for easy_objective_0a218dd8:
  date: 2022-06-03_16-08-12
  done: true
  experiment_id: 5b2fdb3f8a8540c19bdcf0af1038f9ac
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 14.639878836228101
  neg_mean_loss: -14.639878836228101
  node_ip: 127.0.0.1
  pid: 58086
  time_since_restore: 7.43865966796875e-05
  time_this_iter_s: 7.43865966796875e-05
  time_total_s: 7.43865966796875e-05
  timestamp: 1654297692
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0a218dd8
  warmup_time: 0.0020132064819335938
  
Result for easy_objective_0ae604c4:
  date: 2022-06-03_16-08-14
  done: true
  experiment_id: 548a727bf3dc4f09a34c8fc6a6940c52
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 12.022300234864176
  neg_mean_loss: -12.022300234864176
  node_ip: 127.0.0.1
  pid: 58095
  time_since_restore: 9.393692016601562e-05
  time_this_iter_s: 9.393692016601562e-05
  time_total_s: 9.393692016601562e-05
  timestamp: 1654297694
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0ae604c4
  warmup_time: 0.002191781997680664
  
Result for easy_objective_0ba12830:
  date: 2022-06-03_16-08-15
  done: false
  experiment_id: d3d010df0ec84fa29bff49344e4de4e0
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 0.41168988591604894
  neg_mean_loss: -0.41168988591604894
  node_ip: 127.0.0.1
  pid: 58096
  time_since_restore: 9.012222290039062e-05
  time_this_iter_s: 9.012222290039062e-05
  time_total_s: 9.012222290039062e-05
  timestamp: 1654297695
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0ba12830
  warmup_time: 0.002173900604248047
  
== Status ==
Current time: 2022-06-03 16:08:15 (running for 00:00:05.22)
Memory usage on this node: 24.4/64.0 GiB
Using AsyncHyperBand: num_stopped=2
Bracket: Iter 64.000: None | Iter 16.000: 6.7933841355537385 | Iter 4.000: 4.469454370081532 | Iter 1.000: -1.651347384735175
Resources requested: 4.0/10 CPUs, 0/0 GPUs, 0.0/36.26 GiB heap, 0.0/2.0 GiB objects
Current best trial: 0a241f76 with mean_loss=-8.603456159161341 and parameters={'steps': 100, 'width': 17.323522915498703, 'height': -88.3832775663601}
Result logdir: /Users/josephlong/ray_results/my_exp
Number of trials: 6/1000 (4 RUNNING, 2 TERMINATED)
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+
| Trial name              | status     | loc             |   height |    width |     loss |   iter |   total time (s) |   iterations |   neg_mean_loss |
|-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------|
| easy_objective_094d6026 | RUNNING    | 127.0.0.1:58084 | -25.092  | 19.0143  | -2.36521 |     37 |      3.80483     |           36 |         2.36521 |
| easy_objective_0a231efa | RUNNING    | 127.0.0.1:58087 | -68.7963 |  3.11989 | -5.70146 |     25 |      2.52939     |           24 |         5.70146 |
| easy_objective_0a241f76 | RUNNING    | 127.0.0.1:58088 | -88.3833 | 17.3235  | -8.60346 |     25 |      2.53109     |           24 |         8.60346 |
| easy_objective_0ba12830 | RUNNING    | 127.0.0.1:58096 | -95.8831 | 19.3982  | -6.18674 |      2 |      0.108409    |            1 |         6.18674 |
| easy_objective_0a218dd8 | TERMINATED | 127.0.0.1:58086 |  46.3988 | 11.9732  | 14.6399  |      1 |      7.43866e-05 |            0 |       -14.6399  |
| easy_objective_0ae604c4 | TERMINATED | 127.0.0.1:58095 |  20.223  | 14.1615  | 12.0223  |      1 |      9.39369e-05 |            0 |       -12.0223  |
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+


Result for easy_objective_094d6026:
  date: 2022-06-03_16-08-16
  done: false
  experiment_id: 4b2c7ba7a12d4431a3505103b2c5cf42
  hostname: kestrel
  iterations: 48
  iterations_since_restore: 49
  mean_loss: -2.4008183598882016
  neg_mean_loss: 2.4008183598882016
  node_ip: 127.0.0.1
  pid: 58084
  time_since_restore: 5.099965810775757
  time_this_iter_s: 0.11126899719238281
  time_total_s: 5.099965810775757
  timestamp: 1654297696
  timesteps_since_restore: 0
  training_iteration: 49
  trial_id: 094d6026
  warmup_time: 0.002312183380126953
  
Result for easy_objective_0a231efa:
  date: 2022-06-03_16-08-17
  done: false
  experiment_id: 5c2dfffd23d34887902f75bf6113b987
  hostname: kestrel
  iterations: 47
  iterations_since_restore: 48
  mean_loss: -6.241199660085543
  neg_mean_loss: 6.241199660085543
  node_ip: 127.0.0.1
  pid: 58087
  time_since_restore: 5.03344988822937
  time_this_iter_s: 0.10405802726745605
  time_total_s: 5.03344988822937
  timestamp: 1654297697
  timesteps_since_restore: 0
  training_iteration: 48
  trial_id: 0a231efa
  warmup_time: 0.0022521018981933594
  
Result for easy_objective_0a241f76:
  date: 2022-06-03_16-08-17
  done: false
  experiment_id: d04d3c1215504ddeb8ce2c681b797b15
  hostname: kestrel
  iterations: 47
  iterations_since_restore: 48
  mean_loss: -8.716998803293404
  neg_mean_loss: 8.716998803293404
  node_ip: 127.0.0.1
  pid: 58088
  time_since_restore: 5.040818214416504
  time_this_iter_s: 0.10611605644226074
  time_total_s: 5.040818214416504
  timestamp: 1654297697
  timesteps_since_restore: 0
  training_iteration: 48
  trial_id: 0a241f76
  warmup_time: 0.0020360946655273438
  
Result for easy_objective_0a231efa:
  date: 2022-06-03_16-08-19
  done: true
  experiment_id: 5c2dfffd23d34887902f75bf6113b987
  hostname: kestrel
  iterations: 63
  iterations_since_restore: 64
  mean_loss: -6.395490172056568
  neg_mean_loss: 6.395490172056568
  node_ip: 127.0.0.1
  pid: 58087
  time_since_restore: 6.845232963562012
  time_this_iter_s: 0.11025524139404297
  time_total_s: 6.845232963562012
  timestamp: 1654297699
  timesteps_since_restore: 0
  training_iteration: 64
  trial_id: 0a231efa
  warmup_time: 0.0022521018981933594
  
Result for easy_objective_0ba12830:
  date: 2022-06-03_16-08-20
  done: false
  experiment_id: d3d010df0ec84fa29bff49344e4de4e0
  hostname: kestrel
  iterations: 46
  iterations_since_restore: 47
  mean_loss: -9.477484325687673
  neg_mean_loss: 9.477484325687673
  node_ip: 127.0.0.1
  pid: 58096
  time_since_restore: 4.999945878982544
  time_this_iter_s: 0.10393381118774414
  time_total_s: 4.999945878982544
  timestamp: 1654297700
  timesteps_since_restore: 0
  training_iteration: 47
  trial_id: 0ba12830
  warmup_time: 0.002173900604248047
  
== Status ==
Current time: 2022-06-03 16:08:21 (running for 00:00:10.80)
Memory usage on this node: 24.3/64.0 GiB
Using AsyncHyperBand: num_stopped=3
Bracket: Iter 64.000: 7.571511452350496 | Iter 16.000: 8.664830148761421 | Iter 4.000: 7.448973433457863 | Iter 1.000: -1.651347384735175
Resources requested: 4.0/10 CPUs, 0/0 GPUs, 0.0/36.26 GiB heap, 0.0/2.0 GiB objects
Current best trial: 0ba12830 with mean_loss=-9.479816738496348 and parameters={'steps': 100, 'width': 19.398197043239886, 'height': -95.88310114083951}
Result logdir: /Users/josephlong/ray_results/my_exp
Number of trials: 7/1000 (4 RUNNING, 3 TERMINATED)
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+
| Trial name              | status     | loc             |   height |    width |     loss |   iter |   total time (s) |   iterations |   neg_mean_loss |
|-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------|
| easy_objective_094d6026 | RUNNING    | 127.0.0.1:58084 | -25.092  | 19.0143  | -2.44547 |     83 |      8.80579     |           82 |         2.44547 |
| easy_objective_0a241f76 | RUNNING    | 127.0.0.1:58088 | -88.3833 | 17.3235  | -8.75654 |     71 |      7.56847     |           70 |         8.75654 |
| easy_objective_0ba12830 | RUNNING    | 127.0.0.1:58096 | -95.8831 | 19.3982  | -9.47982 |     48 |      5.16258     |           47 |         9.47982 |
| easy_objective_0ef1f5e6 | RUNNING    | 127.0.0.1:58098 |  66.4885 |  4.24678 |          |        |                  |              |                 |
| easy_objective_0a218dd8 | TERMINATED | 127.0.0.1:58086 |  46.3988 | 11.9732  | 14.6399  |      1 |      7.43866e-05 |            0 |       -14.6399  |
| easy_objective_0a231efa | TERMINATED | 127.0.0.1:58087 | -68.7963 |  3.11989 | -6.39549 |     64 |      6.84523     |           63 |         6.39549 |
| easy_objective_0ae604c4 | TERMINATED | 127.0.0.1:58095 |  20.223  | 14.1615  | 12.0223  |      1 |      9.39369e-05 |            0 |       -12.0223  |
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+


Result for easy_objective_0ef1f5e6:
  date: 2022-06-03_16-08-21
  done: true
  experiment_id: 03f06f1e1c224ca5885bfa5f2af737a6
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 16.648852816008436
  neg_mean_loss: -16.648852816008436
  node_ip: 127.0.0.1
  pid: 58098
  time_since_restore: 8.487701416015625e-05
  time_this_iter_s: 8.487701416015625e-05
  time_total_s: 8.487701416015625e-05
  timestamp: 1654297701
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0ef1f5e6
  warmup_time: 0.0024771690368652344
  
Result for easy_objective_094d6026:
  date: 2022-06-03_16-08-21
  done: false
  experiment_id: 4b2c7ba7a12d4431a3505103b2c5cf42
  hostname: kestrel
  iterations: 90
  iterations_since_restore: 91
  mean_loss: -2.451101516749276
  neg_mean_loss: 2.451101516749276
  node_ip: 127.0.0.1
  pid: 58084
  time_since_restore: 10.160415887832642
  time_this_iter_s: 0.1056220531463623
  time_total_s: 10.160415887832642
  timestamp: 1654297701
  timesteps_since_restore: 0
  training_iteration: 91
  trial_id: 094d6026
  warmup_time: 0.002312183380126953
  
Result for easy_objective_0fbee088:
  date: 2022-06-03_16-08-22
  done: true
  experiment_id: 39772bead16242a4958cb200160cf812
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 3.6364993441420124
  neg_mean_loss: -3.6364993441420124
  node_ip: 127.0.0.1
  pid: 58099
  time_since_restore: 9.918212890625e-05
  time_this_iter_s: 9.918212890625e-05
  time_total_s: 9.918212890625e-05
  timestamp: 1654297702
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 0fbee088
  warmup_time: 0.0021059513092041016
  
Result for easy_objective_094d6026:
  date: 2022-06-03_16-08-22
  done: true
  experiment_id: 4b2c7ba7a12d4431a3505103b2c5cf42
  hostname: kestrel
  iterations: 99
  iterations_since_restore: 100
  mean_loss: -2.456355072354658
  neg_mean_loss: 2.456355072354658
  node_ip: 127.0.0.1
  pid: 58084
  time_since_restore: 11.1108238697052
  time_this_iter_s: 0.10416412353515625
  time_total_s: 11.1108238697052
  timestamp: 1654297702
  timesteps_since_restore: 0
  training_iteration: 100
  trial_id: 094d6026
  warmup_time: 0.002312183380126953
  
Result for easy_objective_0a241f76:
  date: 2022-06-03_16-08-22
  done: false
  experiment_id: d04d3c1215504ddeb8ce2c681b797b15
  hostname: kestrel
  iterations: 89
  iterations_since_restore: 90
  mean_loss: -8.77388619436894
  neg_mean_loss: 8.77388619436894
  node_ip: 127.0.0.1
  pid: 58088
  time_since_restore: 10.068812131881714
  time_this_iter_s: 0.10379719734191895
  time_total_s: 10.068812131881714
  timestamp: 1654297702
  timesteps_since_restore: 0
  training_iteration: 90
  trial_id: 0a241f76
  warmup_time: 0.0020360946655273438
  
Result for easy_objective_10773dfe:
  date: 2022-06-03_16-08-23
  done: true
  experiment_id: bc328169a0314547bafd1813d3989216
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 6.0848448591907545
  neg_mean_loss: -6.0848448591907545
  node_ip: 127.0.0.1
  pid: 58100
  time_since_restore: 7.390975952148438e-05
  time_this_iter_s: 7.390975952148438e-05
  time_total_s: 7.390975952148438e-05
  timestamp: 1654297703
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 10773dfe
  warmup_time: 0.0022568702697753906
  
Result for easy_objective_10c1597a:
  date: 2022-06-03_16-08-23
  done: true
  experiment_id: 0c72fc490f9e42a9aabab698f74962f3
  hostname: kestrel
  iterations: 0
  iterations_since_restore: 1
  mean_loss: 8.638900372842315
  neg_mean_loss: -8.638900372842315
  node_ip: 127.0.0.1
  pid: 58101
  time_since_restore: 0.00010967254638671875
  time_this_iter_s: 0.00010967254638671875
  time_total_s: 0.00010967254638671875
  timestamp: 1654297703
  timesteps_since_restore: 0
  training_iteration: 1
  trial_id: 10c1597a
  warmup_time: 0.0020401477813720703
  
Result for easy_objective_0a241f76:
  date: 2022-06-03_16-08-23
  done: true
  experiment_id: d04d3c1215504ddeb8ce2c681b797b15
  hostname: kestrel
  iterations: 99
  iterations_since_restore: 100
  mean_loss: -8.780357708936942
  neg_mean_loss: 8.780357708936942
  node_ip: 127.0.0.1
  pid: 58088
  time_since_restore: 11.13165807723999
  time_this_iter_s: 0.10418009757995605
  time_total_s: 11.13165807723999
  timestamp: 1654297703
  timesteps_since_restore: 0
  training_iteration: 100
  trial_id: 0a241f76
  warmup_time: 0.0020360946655273438
  
Result for easy_objective_0ba12830:
  date: 2022-06-03_16-08-25
  done: false
  experiment_id: d3d010df0ec84fa29bff49344e4de4e0
  hostname: kestrel
  iterations: 88
  iterations_since_restore: 89
  mean_loss: -9.530070398078424
  neg_mean_loss: 9.530070398078424
  node_ip: 127.0.0.1
  pid: 58096
  time_since_restore: 10.001604080200195
  time_this_iter_s: 0.11326789855957031
  time_total_s: 10.001604080200195
  timestamp: 1654297705
  timesteps_since_restore: 0
  training_iteration: 89
  trial_id: 0ba12830
  warmup_time: 0.002173900604248047
  
== Status ==
Current time: 2022-06-03 16:08:25 (running for 00:00:15.36)
Memory usage on this node: 24.1/64.0 GiB
Using AsyncHyperBand: num_stopped=9
Bracket: Iter 64.000: 8.937436293428219 | Iter 16.000: 8.664830148761421 | Iter 4.000: 7.448973433457863 | Iter 1.000: -3.249404442672051
Resources requested: 1.0/10 CPUs, 0/0 GPUs, 0.0/36.26 GiB heap, 0.0/2.0 GiB objects
Current best trial: 0ba12830 with mean_loss=-9.531357243058471 and parameters={'steps': 100, 'width': 19.398197043239886, 'height': -95.88310114083951}
Result logdir: /Users/josephlong/ray_results/my_exp
Number of trials: 10/1000 (1 RUNNING, 9 TERMINATED)
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+
| Trial name              | status     | loc             |   height |    width |     loss |   iter |   total time (s) |   iterations |   neg_mean_loss |
|-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------|
| easy_objective_0ba12830 | RUNNING    | 127.0.0.1:58096 | -95.8831 | 19.3982  | -9.53136 |     91 |     10.2367      |           90 |         9.53136 |
| easy_objective_094d6026 | TERMINATED | 127.0.0.1:58084 | -25.092  | 19.0143  | -2.45636 |    100 |     11.1108      |           99 |         2.45636 |
| easy_objective_0a218dd8 | TERMINATED | 127.0.0.1:58086 |  46.3988 | 11.9732  | 14.6399  |      1 |      7.43866e-05 |            0 |       -14.6399  |
| easy_objective_0a231efa | TERMINATED | 127.0.0.1:58087 | -68.7963 |  3.11989 | -6.39549 |     64 |      6.84523     |           63 |         6.39549 |
| easy_objective_0a241f76 | TERMINATED | 127.0.0.1:58088 | -88.3833 | 17.3235  | -8.78036 |    100 |     11.1317      |           99 |         8.78036 |
| easy_objective_0ae604c4 | TERMINATED | 127.0.0.1:58095 |  20.223  | 14.1615  | 12.0223  |      1 |      9.39369e-05 |            0 |       -12.0223  |
| easy_objective_0ef1f5e6 | TERMINATED | 127.0.0.1:58098 |  66.4885 |  4.24678 | 16.6489  |      1 |      8.4877e-05  |            0 |       -16.6489  |
| easy_objective_0fbee088 | TERMINATED | 127.0.0.1:58099 | -63.635  |  3.66809 |  3.6365  |      1 |      9.91821e-05 |            0 |        -3.6365  |
| easy_objective_10773dfe | TERMINATED | 127.0.0.1:58100 | -39.1516 | 10.4951  |  6.08484 |      1 |      7.39098e-05 |            0 |        -6.08484 |
| easy_objective_10c1597a | TERMINATED | 127.0.0.1:58101 | -13.611  |  5.82458 |  8.6389  |      1 |      0.000109673 |            0 |        -8.6389  |
+-------------------------+------------+-----------------+----------+----------+----------+--------+------------------+--------------+-----------------+


Result for easy_objective_0ba12830:
  date: 2022-06-03_16-08-26
  done: true
  experiment_id: d3d010df0ec84fa29bff49344e4de4e0
  hostname: kestrel
  iterations: 99
  iterations_since_restore: 100
  mean_loss: -9.536507956046009
  neg_mean_loss: 9.536507956046009
  node_ip: 127.0.0.1
  pid: 58096
  time_since_restore: 11.294240951538086
  time_this_iter_s: 0.1278519630432129
  time_total_s: 11.294240951538086
  timestamp: 1654297706
  timesteps_since_restore: 0
  training_iteration: 100
  trial_id: 0ba12830
  warmup_time: 0.002173900604248047
  
Traceback (most recent call last):
  File "/Users/josephlong/devel/measure_starlight_subtraction/klip/find_5sigma_r12/bayesopt_example.py", line 53, in <module>
    analysis = tune.run(
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/tune.py", line 672, in run
    runner.step()
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 765, in step
    next_trial = self._update_trial_queue_and_get_next_trial()
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 698, in _update_trial_queue_and_get_next_trial
    next_trial = self._get_next_trial()  # blocking
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 953, in _get_next_trial
    self._update_trial_queue(blocking=wait_for_trial)
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/trial_runner.py", line 1309, in _update_trial_queue
    trial = self._search_alg.next_trial()
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/suggest/search_generator.py", line 98, in next_trial
    return self.create_trial_if_possible(
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/suggest/search_generator.py", line 108, in create_trial_if_possible
    suggested_config = self.searcher.suggest(trial_id)
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/suggest/suggestion.py", line 529, in suggest
    suggestion = self.searcher.suggest(trial_id)
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/ray/tune/suggest/bayesopt.py", line 263, in suggest
    config = self.optimizer.suggest(self.utility)
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/bayes_opt/bayesian_optimization.py", line 131, in suggest
    suggestion = acq_max(
  File "/Users/josephlong/mambaforge/envs/py39/lib/python3.9/site-packages/bayes_opt/util.py", line 65, in acq_max
    if max_acq is None or -res.fun[0] >= max_acq:
TypeError: 'float' object is not subscriptable

Versions / Dependencies

Using macOS 12.4 Monterey on M1 Max.

python                    3.9.12          hfc7342c_1_cpython    conda-forge
ray                       1.12.1                   pypi_0    pypi
bayesian-optimization     1.2.0                    pypi_0    pypi

Reproduction script

Directly from the docs:

"""This example demonstrates the usage of BayesOpt with Ray Tune.

It also checks that it is usable with a separate scheduler.
"""
import time

from ray import tune
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest import ConcurrencyLimiter
from ray.tune.suggest.bayesopt import BayesOptSearch


def evaluation_fn(step, width, height):
    return (0.1 + width * step / 100) ** (-1) + height * 0.1


def easy_objective(config):
    # Hyperparameters
    width, height = config["width"], config["height"]

    for step in range(config["steps"]):
        # Iterative training function - can be any arbitrary training procedure
        intermediate_score = evaluation_fn(step, width, height)
        # Feed the score back back to Tune.
        tune.report(iterations=step, mean_loss=intermediate_score)
        time.sleep(0.1)


if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--smoke-test", action="store_true", help="Finish quickly for testing"
    )
    parser.add_argument(
        "--server-address",
        type=str,
        default=None,
        required=False,
        help="The address of server to connect to if using Ray Client.",
    )
    args, _ = parser.parse_known_args()

    if args.server_address:
        import ray

        ray.init(f"ray://{args.server_address}")

    algo = BayesOptSearch(utility_kwargs={"kind": "ucb", "kappa": 2.5, "xi": 0.0})
    algo = ConcurrencyLimiter(algo, max_concurrent=4)
    scheduler = AsyncHyperBandScheduler()
    analysis = tune.run(
        easy_objective,
        name="my_exp",
        metric="mean_loss",
        mode="min",
        search_alg=algo,
        scheduler=scheduler,
        num_samples=10 if args.smoke_test else 1000,
        config={
            "steps": 100,
            "width": tune.uniform(0, 20),
            "height": tune.uniform(-100, 100),
        },
    )

    print("Best hyperparameters found were: ", analysis.best_config)

Issue Severity

High: It blocks me from completing my task.

@joseph-long joseph-long added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Jun 3, 2022
@joseph-long
Copy link
Author

Found the upstream issue this came from: bayesian-optimization/BayesianOptimization#320

@joseph-long
Copy link
Author

And the fix (bayesian-optimization/BayesianOptimization#303) is already merged, so there's nothing Ray needs to do here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

No branches or pull requests

1 participant