torchdrug icon indicating copy to clipboard operation
torchdrug copied to clipboard

issue on running tutorial "A Sequence-based Protein Property Predictor"

Open JasonJZhang opened this issue 2 years ago • 1 comments

When running transforms.TruncateProtein, I got the following error. Please help.

TypeError Traceback (most recent call last) Input In [22], in <cell line: 1>() ----> 1 truncate_transform = transforms.TruncateProtein(max_length=350, random=False, residue=True)

File ~\anaconda3\envs\env1\lib\site-packages\decorator.py:231, in decorate..fun(*args, **kw) 229 def fun(*args, **kw): 230 if not kwsyntax: --> 231 args, kw = fix(args, kw, sig) 232 return caller(func, *(extras + args), **kw)

File ~\anaconda3\envs\env1\lib\site-packages\decorator.py:203, in fix(args, kwargs, sig) 199 def fix(args, kwargs, sig): 200 """ 201 Fix args and kwargs to be consistent with the signature 202 """ --> 203 ba = sig.bind(*args, **kwargs) 204 ba.apply_defaults() # needed for test_dan_schult 205 return ba.args, ba.kwargs

File ~\anaconda3\envs\env1\lib\inspect.py:3037, in Signature.bind(self, *args, **kwargs) 3032 def bind(self, /, *args, **kwargs): 3033 """Get a BoundArguments object, that maps the passed args 3034 and kwargs to the function's signature. Raises TypeError 3035 if the passed arguments can not be bound. 3036 """ -> 3037 return self._bind(args, kwargs)

File ~\anaconda3\envs\env1\lib\inspect.py:3026, in Signature._bind(self, args, kwargs, partial) 3024 arguments[kwargs_param.name] = kwargs 3025 else: -> 3026 raise TypeError( 3027 'got an unexpected keyword argument {arg!r}'.format( 3028 arg=next(iter(kwargs)))) 3030 return self._bound_arguments_cls(self, arguments)

TypeError: got an unexpected keyword argument 'residue'

JasonJZhang avatar Sep 29 '22 03:09 JasonJZhang

Hi!

This is because the transform TruncateProtein does not have a 'residue' argument. By default, the transform will truncate the protein in terms of the number of residues. For details, you can refer to https://torchdrug.ai/docs/api/transforms.html#truncateprotein

Oxer11 avatar Oct 09 '22 23:10 Oxer11