-
Notifications
You must be signed in to change notification settings - Fork 11
Description
When running the run_alphafold.py script, I encountered a SyntaxError. The traceback shows that the error occurs during the import process of related modules. Specifically, at line 31 of the alphafold3.jax.attention.attention.py file, there is a @jaxtyping.jaxtyped(typechecker=typeguard.typechecked) decorator used for type checking.
During the type checking process, which involves parsing the abstract syntax tree (AST) of the code using the ast module, an expression *B T H D is encountered. This expression does not conform to Python's syntax rules, resulting in the ast.parse method throwing a SyntaxError.
I have tried several troubleshooting steps, such as checking the relevant code and its type annotations, but have not yet resolved the issue. I am unsure where exactly the *B T H D expression should be modified, and whether it is a wrong comment, variable name, or part of the code.
I have also attempted to update the jaxtyping and typeguard libraries, but the problem persists. I am looking for assistance in resolving this syntax error to ensure the successful execution of the alphafold program.
Here is the complete traceback for reference:
Traceback (most recent call last):
File "/app/alphafold/run_alphafold.py", line 47, in <module>
from alphafold3.model.diffusion.model import Diffuser
File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/model/diffusion/model.py", line 23, in <module>
from alphafold3.model import model_config
File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/model/model_config.py", line 17, in <module>
from alphafold3.jax.attention import attention
File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/jax/attention/attention.py", line 31, in <module>
@jaxtyping.jaxtyped(typechecker=typeguard.typechecked)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/jaxtyping/_decorator.py", line 439, in jaxtyped
full_fn = _apply_typechecker(typechecker, full_fn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/jaxtyped/_decorator.py", line 73, in _apply_typechecker
return typechecker(fn)
^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_decorators.py", line 221, in typechecked
retval = instrument(target)
^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_decorators.py", line 72, in instrument
instrumentor.visit(module_ast)
File "/usr/lib/python3.11/ast.py", line 410, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 598, in visit_Module
self.generic_visit(node)
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 498, in generic_visit
node = super().generic_visit(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ast.py", line 486, in generic_visit
value = self.visit(value)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ast.py", line 410, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 672, in visit_FunctionDef
with self._use_memo(node):
File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 556, in _use_memo
new_memo.return_annotation = self._convert_annotation(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 582, in _convert_annotation
new_annotation = cast(expr, AnnotationTransformer(self).visit(annotation))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 355, in visit
new_node = super().visit(node)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ast.py", line 410, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 421, in visit_Subscript
[self.visit(item) for item in node.slice.elts],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 421, in <listcomp>
[self.visit(item) for item in node.slice.elts],
^^^^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 355, in visit
new_node = super().visit(node)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ast.py", line 410, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/alphafold3_venv/lib/python3.11/site-packages/typeguard/_transformer.py", line 474, in visit_Constant
expression = ast.parse(node.value, mode="eval")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<unknown>", line 1
*B T H D
^
SyntaxError: invalid syntax