cryoem / eman2

A scientific image processing software suite with a focus on CryoEM and CryoET
148 stars 50 forks source link

E2gmm_model_fit.py failed to run #572

Open AAUHFZ opened 3 months ago

AAUHFZ commented 3 months ago

I encountered the following error while running the e2gmm_model_fit-py command. What should I do

building decoder with 13241 Gaussian, using 64 anchor points Traceback (most recent call last): File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 845, in main() File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 284, in main gen_model=build_decoder_CA(pts[None,...], icls, meanzero=False, freeamp=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 37, in build_decoder_CA x0=tf.keras.Input(shape=(ninp)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/layers/core/input_layer.py", line 154, in Input layer = InputLayer( ^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/layers/core/input_layer.py", line 47, in init shape = backend.standardize_shape(shape) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/backend/common/variables.py", line 515, in standardize_shape raise ValueError(f"Cannot convert '{shape}' to a shape.") ValueError: Cannot convert '4' to a shape.

sludtke42 commented 3 months ago

Last week we upgraded the EMAN dependencies from Python 3.11 to 3.12 and Tensorflow 2.12 to 2.16 to fix issues with Jupyter. It appears that there are a few backwards incompatibilities in Tensorflow 2.16. This only seems to have impacted a few programs, most of which seem to be Muyuan's. Unfortunately I think the only solution is to fix the broken code, since it's unlikely Tensorflow will re-allow the things they apparently removed in 2.16. We're running various tests looking for issues, but given the number of programs we may not find everything, so please continue to report any issues you run across!

If you need a quick hack to fix the problem below, I believe changing (ninp) to (ninp,) in line 37 should fix that particular error. Whether there are others in the same program, I have no idea.


Steven Ludtke, @.***

On Aug 25, 2024, at 1:50 AM, AAUHFZ @.***> wrote:

I encountered the following error while running the e2gmm_model_fit-py command. What should I do

building decoder with 13241 Gaussian, using 64 anchor points Traceback (most recent call last): File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 845, in main() File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 284, in main gen_model=build_decoder_CA(pts[None,...], icls, meanzero=False, freeamp=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/bin/e2gmm_model_fit.py", line 37, in build_decoder_CA x0=tf.keras.Input(shape=(ninp)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/layers/core/input_layer.py", line 154, in Input layer = InputLayer( ^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/layers/core/input_layer.py", line 47, in init shape = backend.standardize_shape(shape) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/yuexin/.conda/envs/eman2/lib/python3.12/site-packages/keras/src/backend/common/variables.py", line 515, in standardize_shape raise ValueError(f"Cannot convert '{shape}' to a shape.") ValueError: Cannot convert '4' to a shape.

— Reply to this email directly, view it on GitHubhttps://github.com/cryoem/eman2/issues/572, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACPKF2RN6ACXI27B33QCKFLZTF5CBAVCNFSM6AAAAABNCIXQLCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DKMBZGEYTGMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>


Steven Ludtke, Ph.D. @.***> Baylor College of Medicine Charles C. Bell Jr., Professor of Structural Biology Dept. of Biochemistry Deputy Director, Advanced Technology Cores and Molecular Pharmacology Academic Director, CryoEM Core Co-Director CIBR Center