-
Notifications
You must be signed in to change notification settings - Fork 1
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
ValueError: operands could not be broadcast together with shapes (5305,10) (18027,) (5305,10) #15
Comments
Hi wangqihao, First, I am very sorry for taking so long to get back to you. I double-checked this example and it works fine on my laptop (M2 Macbook Pro). Given where the error occurs, would you be able to tell me your versions of anndata, scanpy, and possibly tensorflow? Thanks! Best wishes, |
Hi axel:
my environment versions are as follows: absl-py 2.1.0 Please check these PS: site-factorization packages is not suitable for python3.8, so python 3.10 was used for this env. |
Dear Axel,
I use the data you gave :
“burkhardt21_merged.h5ad”
“burkhardt21_communications_Ctrl.csv”
“burkhardt21_communications_IFNg.csv”
I encountered a problem when running the following code:
fs.pp.construct_flows_from_cellchat(adata,
cellchat_output_key,
gem_expr_key = 'X_gem',
scale_gem_expr = True,
model_organism = 'human',
flowsig_network_key = 'flowsig_network',
flowsig_expr_key = 'X_flow')
The error message is as follows:
/opt/anaconda3/envs/Python/bin/python /home/inspur/FlowSig/pancreatic_islets_example_script.py
2024-09-26 15:06:59.948040: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable
TF_ENABLE_ONEDNN_OPTS=0
.2024-09-26 15:06:59.949669: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-09-26 15:06:59.983754: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-09-26 15:07:00.613010: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Removing 6624 genes not expressing in IFNg.
Removing 7700 genes not expressing in Ctrl.
100%|██████████| 30/30 [00:02<00:00, 10.24it/s]
Traceback (most recent call last):
File "/home/inspur/FlowSig/pancreatic_islets_example_script.py", line 23, in
fs.pp.construct_flows_from_cellchat(adata,
File "/opt/anaconda3/envs/Python/lib/python3.8/site-packages/flowsig/preprocessing/_flow_expressions.py", line 233, in construct_flows_from_cellchat
adata_gem, flow_gem_vars = construct_gem_expressions(adata, gem_expr_key, scale_gem_expr)
File "/opt/anaconda3/envs/Python/lib/python3.8/site-packages/flowsig/preprocessing/_flow_expressions.py", line 27, in construct_gem_expressions
adata_gem.X *= scale_factor
ValueError: operands could not be broadcast together with shapes (5305,10) (18027,) (5305,10)
I would appreciate if you could answer for me.
The text was updated successfully, but these errors were encountered: