RosettaCommons / RFDesign

Protein hallucination and inpainting with RoseTTAFold
Other
239 stars 66 forks source link

Error while running af2_interface_metrics.py #13

Closed jongseo-park closed 2 years ago

jongseo-park commented 2 years ago

Hi,

According your suggestions, I tried to run af2_interface_metrics.py to validate the plausibility of my hallucinated binder after creating silent file.

However there is an error as below.

Is it an error originated from the af2_interface_metrics.py ?

or from my conda environment setting ?

I attached my conda export file too.

command CUDA_VISIBLE_DEVICES=1 python3 /opt/tools/RFDesign/scripts/af2_interface_metrics.py -silent in.silent

terminal message /opt/tools/RFDesign/scripts/af2_interface_metrics.py:46: UserWarning: Import of 'rosetta' as a top-level module is deprecated and may be removed in 2018, import via 'pyrosetta.rosetta'. from rosetta import PyRosetta-4 2022 [Rosetta PyRosetta4.Release.python39.ubuntu 2022.23+release.f1e0f6d7bf74728d46e42a39ffab1eedf8c1c936 2022-06-09T16:58:25] retrieved from: http://www.pyrosetta.org (C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team. core.init: Checking for fconfig files in pwd and ./rosetta/flags core.init: Rosetta version: PyRosetta4.Release.python39.ubuntu r321 2022.23+release.f1e0f6d7bf7 f1e0f6d7bf74728d46e42a39ffab1eedf8c1c936 http://www.pyrosetta.org 2022-06-09T16:58:25 core.init: command: PyRosetta -in:file:silent_struct_type binary -database /opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/pyrosetta-2022.23+release.f1e0f6d7bf7-py3.9-linux-x86_64.egg/pyrosetta/database basic.random.init_random_generator: 'RNG device' seed mode, using '/dev/urandom', seed=-1724994589 seed_offset=0 real_seed=-1724994589 basic.random.init_random_generator: RandomGenerator:init: Normal mode, seed=-1724994589 RG_type=mt19937 core.io.silent.SilentFileData: Reading all structures from in.silent core.io.silent.SilentFileData: Finished reading 18 structures from in.silent core.chemical.GlobalResidueTypeSet: Finished initializing fa_standard residue type set. Created 985 residue types core.chemical.GlobalResidueTypeSet: Total time to initialize 0.57772 seconds. The distance between residues 55 and 56 is 19.21 A > limit 3 A. I'm going to insert a chainbreak after residue 55 running model_1_ptm ['run_1_gpu_0_10'] Traceback (most recent call last): File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 598, in predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename) File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 432, in predict_structure prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params, File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/traceback_util.py", line 183, in reraise_with_filtered_traceback return fun(args, kwargs) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/api.py", line 1294, in batched_fun out_flat = batching.batch( File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 166, in call_wrapped ans = self.f(args, dict(self.params, kwargs)) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/traceback_util.py", line 183, in reraise_with_filtered_traceback return fun(args, kwargs) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/api.py", line 424, in cache_miss out_flat = xla.xla_call( File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1560, in bind return call_bind(self, fun, *args, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1551, in call_bind outs = primitive.process(top_trace, fun, tracers, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1563, in process return trace.process_call(self, fun, tracers, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/batching.py", line 159, in process_call vals_out = call_primitive.bind(f, *vals, *params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1560, in bind return call_bind(self, fun, args, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1551, in call_bind outs = primitive.process(top_trace, fun, tracers, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1563, in process return trace.process_call(self, fun, tracers, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 606, in process_call return primitive.impl(f, *tracers, params) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/xla.py", line 592, in _xla_call_impl compiled_fun = _xla_callable(fun, device, backend, name, donated_invars, File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 262, in memoized_fun ans = call(fun, args) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/xla.py", line 667, in _xla_callable jaxpr, out_avals, consts = pe.trace_to_jaxpr_final( File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/partial_eval.py", line 1284, in trace_to_jaxpr_final jaxpr, out_avals, consts = trace_to_subjaxpr_dynamic(fun, main, in_avals) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/partial_eval.py", line 1262, in trace_to_subjaxpr_dynamic ans = fun.call_wrapped(in_tracers) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 166, in call_wrapped ans = self.f(args, dict(self.params, kwargs)) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 125, in apply_fn out, state = f.apply(params, {}, args, kwargs) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 313, in apply_fn out = f(*args, **kwargs) jax._src.traceback_util.UnfilteredStackTrace: TypeError: _forward_fn() takes 1 positional argument but 2 were given

The stack trace below excludes JAX-internal frames. The preceding is the original exception that occurred, unmodified.


The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 598, in predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename) File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 432, in predict_structure prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params, File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 125, in apply_fn out, state = f.apply(params, {}, *args, *kwargs) File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 313, in apply_fn out = f(args, **kwargs) TypeError: _forward_fn() takes 1 positional argument but 2 were given

conda export afscore_forbinder_requirements.txt

jongseo-park commented 2 years ago

Based on the error message, this error seems to be caused by an additional argument provided to the _forward_fn().

So, I tried to remove one argument processed_initial_guess_dict in the af2_interface_metrics.py, line 431 as below.

from prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params, jax.random.PRNGKey(0), processed_feature_dict, processed_initial_guess_dict)

to prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0))(model_runner.params, jax.random.PRNGKey(0), processed_feature_dict)

and then the script worked fine.

In the case of deletion of processed_feature_dict rather than processed_initial_guess_dict, another error was occurred.

However, I don't think this is a right solution.

I wonder what is a real proper solution.

Sincerely

Jongseo