Closed henbucuoshanghai closed 3 years ago
不太明白?你是写了个动态图?在forward时候if判断了? 能否贴个错误
你好 热心的回复 能留邮箱吗 我是1119006913@qq
site-packages/torch/jit/_recursive.py", line 292, in create_methods_from_stubs concrete_type._create_methods(defs, rcbs, defaults) RuntimeError:
forward(torch.model.VGG.VGG16_FPN.FPN self, Tensor inputs) -> ((Tensor, Tensor, Tensor)): Expected a value of type 'Tensor (inferred)' for argument 'inputs' but instead found type 'List[Tensor]'. Inferred 'inputs' to be of type 'Tensor' because it was not annotated with an explicit type. Empty lists default to List[Tensor]. Add a variable annotation to the assignment to create an empty list of another type (torch.jit.annotate(List[T, []]) where T is the type of elements in the list for Python 2)
trace可能用tuple要比list好,你改成tuple传输就好了应该 加你QQ了,发现以前加过你创建的群,缘分呐
@AllentDan 请问建立的技术讨论群号是多少
trace 或script的时候? pytorch官网下面有一样的报错,但是无准确 准确解答。 请问怎么办