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

Numpy issue in strategies #172

Closed
njoseGIT opened this issue Apr 20, 2022 · 3 comments
Closed

Numpy issue in strategies #172

njoseGIT opened this issue Apr 20, 2022 · 3 comments

Comments

@njoseGIT
Copy link

  • Operating System: Windows 10 Home Version 21H2 Build 19044.1645
  • Python version: 3.10
  • summit version used: 0.8.4
  • Using pycharm

Description

Was testing out the strategies module and ran into issues with numpy

What I Did

scratch.py

from summit import *
import numpy as np

domain = Domain()

domain += ContinuousVariable(name="x_0",
description="reaction temperature in celsius",
bounds=[50, 100])

domain += ContinuousVariable(name="x_1",
description="flow of reactant a in mL/min",
bounds=[0.1, 0.5])

domain += ContinuousVariable(name="y_0",
description="yield",
bounds=[0.1, 0.5],
is_objective=True,
maximize=True)

domain += ContinuousVariable(name="y_1",
description="cost",
bounds=[0.1, 0.5],
is_objective=True,
maximize=True)

strategy = LHS(domain, random_state=np.random.RandomState(3))

results = strategy.suggest_experiments(5)

strategy_lhs = LHS(domain, random_state=np.random.RandomState(3))
results = strategy.suggest_experiments(5)
print(results)

strategy_tsemo = TSEMO(domain)
experiments = strategy_tsemo.suggest_experiments(5)
print(experiments)

Error message:

"C:\Users\njose\Dropbox (Cambridge CARES)\Python\idmt_codeshare\pyflab_CURRENT\venv\Scripts\python.exe" "C:/Users/njose/Dropbox (Cambridge CARES)/Python/idmt_codeshare/pyflab_CURRENT/scratch.py"
C:\Users\njose\Dropbox (Cambridge CARES)\Python\idmt_codeshare\pyflab_CURRENT\venv\lib\site-packages\torch_masked_init_.py:223: UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:68.)
example_input = torch.tensor([[-3, -2, -1], [0, 1, 2]])
Traceback (most recent call last):
File "C:\Users\njose\Dropbox (Cambridge CARES)\Python\idmt_codeshare\pyflab_CURRENT\scratch.py", line 25, in
strategy = LHS(domain, random_state=np.random.RandomState(3))
NameError: name 'np' is not defined

Process finished with exit code 1

@marcosfelt
Copy link
Member

Hi Nick! I think I just need to push an new version from master. I will do that this morning!

@njoseGIT
Copy link
Author

njoseGIT commented Apr 21, 2022 via email

This was referenced Apr 25, 2022
@marcosfelt
Copy link
Member

Closing in favor of #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants