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

Yield "operands could not be broadcast together with shapes (11,) (10,)" when running Pereira2018 on gpt2 #51

Open
Leo1xuan opened this issue Nov 7, 2024 · 0 comments

Comments

@Leo1xuan
Copy link

Leo1xuan commented Nov 7, 2024

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/gpt/lyx/neural-nlp/neural_nlp/main.py", line 38, in
fire.Fire(command=FIRE_FLAGS)
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/fire/core.py", line 135, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/fire/core.py", line 468, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/fire/core.py", line 684, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/lyx/neural-nlp/neural_nlp/main.py", line 23, in run
score = score_function(model='gpt2-medium', layers=layers, subsample=subsample, benchmark='Pereira2018-encoding')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/result_caching/init.py", line 80, in wrapper
result = function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/neural_nlp-0.1.0-py3.11.egg/neural_nlp/init.py", line 39, in score
layer_score = benchmark_impl(candidate)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/brainscore_vision/utils/init.py", line 80, in call
return self.content(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/neural_nlp-0.1.0-py3.11.egg/neural_nlp/benchmarks/neural.py", line 371, in call
model_activations = listen_to(candidate, stimulus_set)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/neural_nlp-0.1.0-py3.11.egg/neural_nlp/benchmarks/neural.py", line 478, in listen_to
model_activations = merge_data_arrays(activations)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/brainio/assemblies.py", line 326, in merge_data_arrays
merged = xr.merge((data_array.rename('z') for data_array in data_arrays))['z'].rename(None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/xarray/core/merge.py", line 857, in merge
merge_result = merge_core(
^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/xarray/core/merge.py", line 591, in merge_core
aligned = deep_align(
^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/xarray/core/alignment.py", line 406, in deep_align
aligned = align(
^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/xarray/core/alignment.py", line 307, in align
index = joiner(matching_indexes)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/pandas/core/ops/common.py", line 81, in new_method
return method(self, other)
^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/pandas/core/arraylike.py", line 78, in or
return self.logical_method(other, operator.or)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 6799, in _logical_method
res_values = ops.logical_op(lvalues, rvalues, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/pandas/core/ops/array_ops.py", line 401, in logical_op
res_values = na_logical_op(lvalues, rvalues, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gpt/anaconda3/envs/torch2/lib/python3.11/site-packages/pandas/core/ops/array_ops.py", line 311, in na_logical_op
result = op(x, y)
Yield “operands could not be broadcast together with shapes (11,) (10,)”,
I'm using command 'python neural_nlp run --model gpt2 --benchmark Blank2014fROI-encoding --log_level DEBUG', which just switch the model from 'gpt2-xl' to 'gpt2' in your example command.

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

No branches or pull requests

1 participant