stanfordnqp / spins-b-meep

SPINS-B integration with Meep solver
GNU General Public License v3.0
11 stars 5 forks source link

ValueError: setting an array element with a sequence. #1

Closed FalconFlight1 closed 4 years ago

FalconFlight1 commented 4 years ago

**Hello, I am trying to install spins-b-meep and run the ben90.py in this project. I installed meep first and then pip3 install ./spins-b-meep

Here is the error when I run python3 bend90.py run myrun**

python3 bend90.py run myrun

[[23409,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces:

Module: OpenFabrics (openib) Host: instance-3

Another transport will be used instead, although this may result in lower performance.

NOTE: You can disable this warning by setting the MCA parameter btl_base_warn_component_unused to 0.

Using MPI version 3.1, 1 processes [2020-07-03 13:50:23,793][INFO][optplan][run] Running action 0 (goos.action.set_variable.0). [2020-07-03 13:50:23,794][INFO][optplan][write_checkpoint] Saving checkpoint file: myrun/action0.chkpt [2020-07-03 13:50:23,796][INFO][optplan][run] Running action 1 (opt_cont4). Traceback (most recent call last): File "bend90.py", line 257, in main(args.save_folder, visualize=False) File "bend90.py", line 87, in main plan.run() File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/optplan/optplan.py", line 563, in run self._actions[self._action_ptr].run(self) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/optimize.py", line 252, in run **options)

File "/usr/lib/python3/dist-packages/scipy/optimize/_minimize.py", line 450, in minimize callback=callback, options) File "/usr/lib/python3/dist-packages/scipy/optimize/lbfgsb.py", line 328, in _minimize_lbfgsb f, g = func_and_grad(x) File "/usr/lib/python3/dist-packages/scipy/optimize/lbfgsb.py", line 278, in func_and_grad f = fun(x, args) File "/usr/lib/python3/dist-packages/scipy/optimize/optimize.py", line 292, in function_wrapper return function((wrapper_args + args)) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/optimize.py", line 126, in func val = plan.eval_node(self._obj).array File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/optplan/optplan.py", line 671, in eval_node return self.eval_nodes([node])[0] File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/optplan/optplan.py", line 658, in eval_nodes return graph_executor.eval_fun(nodes, override_map) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/graph_executor.py", line 95, in eval_fun _eval_fun_vals(fun_vals, fun_flags, fun_map, graph, top_sorted_nodes) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/graph_executor.py", line 184, in _eval_fun_vals node, input_vals, input_flags) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/graph_executor.py", line 157, in _eval_fun_and_flags goos.EvalContext(input_flags)) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/graph_executor.py", line 134, in _eval_fun return node.eval(input_vals) File "/usr/local/lib/python3.6/site-packages/spins-b/spins/goos/math.py", line 292, in eval flow.array = np.prod([x.array for x in inputs], axis=0) File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 2518, in prod out=out, kwargs) File "/usr/lib/python3/dist-packages/numpy/core/_methods.py", line 35, in _prod return umr_prod(a, axis, dtype, out, keepdims) ValueError: setting an array element with a sequence.

Elapsed run time = 0.9485 s

Is there any workaround for this error? Thank you.

FalconFlight1 commented 4 years ago

Problem Solved by changing the env