Advertisement

pytorch高版本(如1.7.0)RuntimeError: Legacy autograd function with non-static forward method is deprecate

阅读量:

在进行一次前向推理的过程中,系统同样出现了错误提示。。。

代码:

复制代码
    from torchvision import models
    model = models.vgg19(pretrained=True)
    output = model(input.cuda())
    
    
    AI写代码python
复制代码
    RuntimeError: Legacy autograd function with non-static forward method is deprecated.
    
    
    AI写代码bash

完整报错信息如下:

复制代码
    Traceback (most recent call last):
      File "/home/user1/pjs/frvt_pytorch/batch_run/2branch_alter_1update_2pfc_MMD_ori_auto/recognition/arcface_torch/tools/visualize.py", line 373, in <module>
    gb = gb_model(input, index=target_index)
      File "/home/user1/pjs/frvt_pytorc

全部评论 (0)

还没有任何评论哟~