Formatting issues in Windows
Hello, when executed in Windows, the optimization have some weird formatting errors. Like this:
| iter | target | bits | size |
| [0m 1 [0m | [0m 1.0 [0m | [0m 21.34 [0m | [0m 1.476e+0[0m | | [0m 2 [0m | [0m 1.0 [0m | [0m 8.004 [0m | [0m 620.6 [0m | | [0m 3 [0m | [0m 1.0 [0m | [0m 12.7 [0m | [0m 190.9 [0m | | [0m 4 [0m | [0m 1.0 [0m | [0m 13.96 [0m | [0m 709.0 [0m | | [0m 5 [0m | [0m 1.0 [0m | [0m 20.7 [0m | [0m 1.104e+0[0m | | [0m 6 [0m | [0m 1.0 [0m | [0m 21.41 [0m | [0m 1.404e+0[0m | | [0m 7 [0m | [0m 1.0 [0m | [0m 14.54 [0m | [0m 1.799e+0[0m | | [0m 8 [0m | [0m 1.0 [0m | [0m 8.876 [0m | [0m 1.374e+0[0m | | [0m 9 [0m | [0m 1.0 [0m | [0m 21.35 [0m | [0m 1.145e+0[0m | | [0m 10 [0m | [0m 1.0 [0m | [0m 12.49 [0m | [0m 407.3 [0m |
I have the same issue
Oh, I believe the way colours are implemented is not compatible with Windows.
Unfortunately I don't have the bandwidth to fix this currently (nor do I have a way of testing it), so PRs are more than welcome.
@fmfn I heard about a python module called colorama that may help fixing this issue. https://pypi.org/project/colorama/ I haven't personally tried it out yet but it seems promising.
Yep, colorama will definitely do the trick, and it shouldn't be too much work either. Still, I don't plan on tackling this anytime soon.
Hi, did someone succeed in solving this issue? I'm currently having similar problems
Hi, I just checked in windows with the following code snippet which logs correctly to the screen, so as far as I can tell this is resolved. However, if anyone can post some code that reproduces the issues I will reopen.
from bayes_opt import BayesianOptimization
def black_box_function(x, y):
"""Function with unknown internals we wish to maximize.
This is just serving as an example, for all intents and
purposes think of the internals of this function, i.e.: the process
which generates its output values, as unknown.
"""
return -x ** 2 - (y - 1) ** 2 + 1
# Bounded region of parameter space
pbounds = {'x': (2, 4), 'y': (-3, 3)}
optimizer = BayesianOptimization(
f=black_box_function,
pbounds=pbounds,
random_state=1,
)
optimizer.maximize(
init_points=2,
n_iter=3,
)
produces:
Looks like the problem persists when using powershell, see the recent comment in #257.
@windowshopr could you install from my feature branch by running
pip install -U git+https://github.com/till-m/BayesianOptimization@colorama
and then let me know if the issue persists?
@till-m
Looks like that fixed it for powershell on my machine!
