Skip to content
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

TypeError: resolve_type_from_object() #77

Open
za13 opened this issue Sep 10, 2020 · 0 comments
Open

TypeError: resolve_type_from_object() #77

za13 opened this issue Sep 10, 2020 · 0 comments

Comments

@za13
Copy link

za13 commented Sep 10, 2020

I tried

source venv/bin/activate

python train.py --evaluate --snapshot checkpoints/best_cityscapes_checkpoint.pth

and got the error below:

Traceback (most recent call last):
  File "train.py", line 19, in <module>
    from utils.misc import AverageMeter, prep_experiment, evaluate_eval, fast_hist
  File "/home/me/Desktop/GSCNN/utils/misc.py", line 18, in <module>
    import torchvision.transforms as standard_transforms
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torchvision/__init__.py", line 3, in <module>
    from torchvision import models
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torchvision/models/__init__.py", line 12, in <module>
    from . import detection
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torchvision/models/detection/__init__.py", line 1, in <module>
    from .faster_rcnn import *
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torchvision/models/detection/faster_rcnn.py", line 14, in <module>
    from .roi_heads import RoIHeads
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torchvision/models/detection/roi_heads.py", line 210, in <module>
    @torch.jit.script
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/__init__.py", line 1290, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/_recursive.py", line 568, in try_compile_fn
    return torch.jit.script(fn, _rcb=rcb)
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/__init__.py", line 1290, in script
    fn = torch._C._jit_script_compile(qualified_name, ast, _rcb, get_default_args(obj))
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/__init__.py", line 2030, in _get_overloads
    compiled_fns.append(_compile_function_with_overload(overload_fn, qual_name, obj))
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/__init__.py", line 2010, in _compile_function_with_overload
    overload_signature = torch.jit.annotations.get_signature(overload_fn, None, None, inspect.ismethod(overload_fn))
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/annotations.py", line 79, in get_signature
    signature = parse_type_line(type_line, rcb, loc)
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/annotations.py", line 165, in parse_type_line
    arg_types = [ann_to_type(ann, loc) for ann in arg_ann]
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/annotations.py", line 165, in <listcomp>
    arg_types = [ann_to_type(ann, loc) for ann in arg_ann]
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/annotations.py", line 303, in ann_to_type
    the_type = try_ann_to_type(ann, loc)
  File "/home/me/Desktop/GSCNN/venv/lib/python3.5/site-packages/torch/jit/annotations.py", line 296, in try_ann_to_type
    the_type = torch._C._resolve_type_from_object(ann, loc, fake_rcb)
TypeError: _resolve_type_from_object(): incompatible function arguments. The following argument types are supported:
    1. (arg0: object, arg1: torch._C._jit_tree_views.SourceRange, arg2: Callable[[str], function]) -> torch._C.Type

Invoked with: typing.Union[int, NoneType], None, <function try_ann_to_type.<locals>.fake_rcb at 0x7fb1b275fe18>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant